updated to work with latest node version

This commit is contained in:
kashepavadan 2026-05-14 22:02:45 -04:00
parent e88dff6f8c
commit 4032725a53
9 changed files with 477 additions and 387 deletions

406
Cargo.lock generated
View File

@ -115,7 +115,7 @@ version = "1.1.5"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "40c48f72fd53cd289104fc64099abca73db4166ad86ea0b4341abe65af83dadc" checksum = "40c48f72fd53cd289104fc64099abca73db4166ad86ea0b4341abe65af83dadc"
dependencies = [ dependencies = [
"windows-sys 0.61.2", "windows-sys 0.60.2",
] ]
[[package]] [[package]]
@ -126,7 +126,7 @@ checksum = "291e6a250ff86cd4a820112fb8898808a366d8f9f58ce16d1f538353ad55747d"
dependencies = [ dependencies = [
"anstyle", "anstyle",
"once_cell_polyfill", "once_cell_polyfill",
"windows-sys 0.61.2", "windows-sys 0.60.2",
] ]
[[package]] [[package]]
@ -580,19 +580,6 @@ checksum = "86887daca11d02e0b04f37a9cb81888aae881397fb48ff66494e356aea97554a"
dependencies = [ dependencies = [
"itertools 0.10.5", "itertools 0.10.5",
"lazy_static", "lazy_static",
"rand 0.8.5",
"serde",
]
[[package]]
name = "async-channel"
version = "1.9.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "81953c529336010edd6d8e358f886d9581267795c61b19475b71314bffa46d35"
dependencies = [
"concurrent-queue",
"event-listener 2.5.3",
"futures-core",
] ]
[[package]] [[package]]
@ -607,46 +594,6 @@ dependencies = [
"pin-project-lite", "pin-project-lite",
] ]
[[package]]
name = "async-executor"
version = "1.14.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c96bf972d85afc50bf5ab8fe2d54d1586b4e0b46c97c50a0c9e71e2f7bcd812a"
dependencies = [
"async-task",
"concurrent-queue",
"fastrand",
"futures-lite",
"pin-project-lite",
"slab",
]
[[package]]
name = "async-fs"
version = "2.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8034a681df4aed8b8edbd7fbe472401ecf009251c8b40556b304567052e294c5"
dependencies = [
"async-lock",
"blocking",
"futures-lite",
]
[[package]]
name = "async-global-executor"
version = "2.4.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "05b1b633a2115cd122d73b955eadd9916c18c8f510ec9cd1686404c60ad1c29c"
dependencies = [
"async-channel 2.5.0",
"async-executor",
"async-io",
"async-lock",
"blocking",
"futures-lite",
"once_cell",
]
[[package]] [[package]]
name = "async-io" name = "async-io"
version = "2.6.0" version = "2.6.0"
@ -665,46 +612,6 @@ dependencies = [
"windows-sys 0.61.2", "windows-sys 0.61.2",
] ]
[[package]]
name = "async-lock"
version = "3.4.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "290f7f2596bd5b78a9fec8088ccd89180d7f9f55b94b0576823bbbdc72ee8311"
dependencies = [
"event-listener 5.4.1",
"event-listener-strategy",
"pin-project-lite",
]
[[package]]
name = "async-net"
version = "2.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b948000fad4873c1c9339d60f2623323a0cfd3816e5181033c6a5cb68b2accf7"
dependencies = [
"async-io",
"blocking",
"futures-lite",
]
[[package]]
name = "async-process"
version = "2.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fc50921ec0055cdd8a16de48773bfeec5c972598674347252c0399676be7da75"
dependencies = [
"async-channel 2.5.0",
"async-io",
"async-lock",
"async-signal",
"async-task",
"blocking",
"cfg-if",
"event-listener 5.4.1",
"futures-lite",
"rustix 1.1.4",
]
[[package]] [[package]]
name = "async-recursion" name = "async-recursion"
version = "1.1.1" version = "1.1.1"
@ -716,56 +623,6 @@ dependencies = [
"syn 2.0.117", "syn 2.0.117",
] ]
[[package]]
name = "async-signal"
version = "0.2.13"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "43c070bbf59cd3570b6b2dd54cd772527c7c3620fce8be898406dd3ed6adc64c"
dependencies = [
"async-io",
"async-lock",
"atomic-waker",
"cfg-if",
"futures-core",
"futures-io",
"rustix 1.1.4",
"signal-hook-registry",
"slab",
"windows-sys 0.61.2",
]
[[package]]
name = "async-std"
version = "1.13.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2c8e079a4ab67ae52b7403632e4618815d6db36d2a010cfe41b02c1b1578f93b"
dependencies = [
"async-channel 1.9.0",
"async-global-executor",
"async-io",
"async-lock",
"crossbeam-utils",
"futures-channel",
"futures-core",
"futures-io",
"futures-lite",
"gloo-timers",
"kv-log-macro",
"log",
"memchr",
"once_cell",
"pin-project-lite",
"pin-utils",
"slab",
"wasm-bindgen-futures",
]
[[package]]
name = "async-task"
version = "4.7.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8b75356056920673b02621b35afd0f7dda9306d03c79a30f5c56c44cf256e3de"
[[package]] [[package]]
name = "async-trait" name = "async-trait"
version = "0.1.89" version = "0.1.89"
@ -885,7 +742,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cffb0e931875b666fc4fcb20fee52e9bbd1ef836fd9e9e04ec21555f9f85f7ef" checksum = "cffb0e931875b666fc4fcb20fee52e9bbd1ef836fd9e9e04ec21555f9f85f7ef"
dependencies = [ dependencies = [
"fastrand", "fastrand",
"gloo-timers",
"tokio", "tokio",
] ]
@ -1022,19 +878,6 @@ dependencies = [
"generic-array 0.14.7", "generic-array 0.14.7",
] ]
[[package]]
name = "blocking"
version = "1.6.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e83f8d02be6967315521be875afa792a316e28d57b5a2d401897e2a7921b7f21"
dependencies = [
"async-channel 2.5.0",
"async-task",
"futures-io",
"futures-lite",
"piper",
]
[[package]] [[package]]
name = "bs58" name = "bs58"
version = "0.5.1" version = "0.5.1"
@ -1141,17 +984,6 @@ version = "0.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724" checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724"
[[package]]
name = "cfg_eval"
version = "0.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "45565fc9416b9896014f5732ac776f810ee53a66730c17e4020c3ec064a8f88f"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.117",
]
[[package]] [[package]]
name = "chacha20" name = "chacha20"
version = "0.9.1" version = "0.9.1"
@ -1348,6 +1180,15 @@ version = "0.4.3"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2f421161cb492475f1661ddc9815a745a1c894592070661180fdec3d4872e9c3" checksum = "2f421161cb492475f1661ddc9815a745a1c894592070661180fdec3d4872e9c3"
[[package]]
name = "convert_case"
version = "0.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ec182b0ca2f35d8fc196cf3404988fd8b8c739a4d270ff118a398feb0cbec1ca"
dependencies = [
"unicode-segmentation",
]
[[package]] [[package]]
name = "convert_case" name = "convert_case"
version = "0.8.0" version = "0.8.0"
@ -1644,7 +1485,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7ab67060fc6b8ef687992d439ca0fa36e7ed17e9a0b16b25b601e8757df720de" checksum = "7ab67060fc6b8ef687992d439ca0fa36e7ed17e9a0b16b25b601e8757df720de"
dependencies = [ dependencies = [
"data-encoding", "data-encoding",
"syn 2.0.117", "syn 1.0.109",
] ]
[[package]] [[package]]
@ -1708,6 +1549,7 @@ dependencies = [
"chrono", "chrono",
"crypto-common", "crypto-common",
"directories", "directories",
"logos-blockchain-core",
"logos-blockchain-zone-sdk", "logos-blockchain-zone-sdk",
"nanosql", "nanosql",
"rand 0.9.2", "rand 0.9.2",
@ -1889,7 +1731,7 @@ dependencies = [
"libc", "libc",
"option-ext", "option-ext",
"redox_users", "redox_users",
"windows-sys 0.61.2", "windows-sys 0.59.0",
] ]
[[package]] [[package]]
@ -2097,7 +1939,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb" checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb"
dependencies = [ dependencies = [
"libc", "libc",
"windows-sys 0.61.2", "windows-sys 0.52.0",
] ]
[[package]] [[package]]
@ -2106,12 +1948,6 @@ version = "3.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "dea2df4cf52843e0452895c455a1a2cfbb842a1e7329671acf418fdc53ed4c59" checksum = "dea2df4cf52843e0452895c455a1a2cfbb842a1e7329671acf418fdc53ed4c59"
[[package]]
name = "event-listener"
version = "2.5.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0"
[[package]] [[package]]
name = "event-listener" name = "event-listener"
version = "5.4.1" version = "5.4.1"
@ -2129,7 +1965,7 @@ version = "0.5.4"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8be9f3dfaaffdae2972880079a491a1a8bb7cbed0b8dd7a347f668b4150a3b93" checksum = "8be9f3dfaaffdae2972880079a491a1a8bb7cbed0b8dd7a347f668b4150a3b93"
dependencies = [ dependencies = [
"event-listener 5.4.1", "event-listener",
"pin-project-lite", "pin-project-lite",
] ]
@ -2330,10 +2166,7 @@ version = "2.6.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f78e10609fe0e0b3f4157ffab1876319b5b0db102a2c60dc4626306dc46b44ad" checksum = "f78e10609fe0e0b3f4157ffab1876319b5b0db102a2c60dc4626306dc46b44ad"
dependencies = [ dependencies = [
"fastrand",
"futures-core", "futures-core",
"futures-io",
"parking",
"pin-project-lite", "pin-project-lite",
] ]
@ -2479,18 +2312,6 @@ version = "0.3.3"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0cc23270f6e1808e30a928bdc84dea0b9b4136a8bc82338574f23baf47bbd280" checksum = "0cc23270f6e1808e30a928bdc84dea0b9b4136a8bc82338574f23baf47bbd280"
[[package]]
name = "gloo-timers"
version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bbb143cf96099802033e0d4f4963b19fd2e0b728bcf076cd9cf7f6634f092994"
dependencies = [
"futures-channel",
"futures-core",
"js-sys",
"wasm-bindgen",
]
[[package]] [[package]]
name = "group" name = "group"
version = "0.13.0" version = "0.13.0"
@ -3010,7 +2831,6 @@ dependencies = [
"netlink-proto", "netlink-proto",
"netlink-sys", "netlink-sys",
"rtnetlink", "rtnetlink",
"smol",
"system-configuration 0.7.0", "system-configuration 0.7.0",
"tokio", "tokio",
"windows", "windows",
@ -3176,7 +2996,7 @@ checksum = "3640c1c38b8e4e43584d8df18be5fc6b0aa314ce6ebf51b53313d4306cca8e46"
dependencies = [ dependencies = [
"hermit-abi", "hermit-abi",
"libc", "libc",
"windows-sys 0.61.2", "windows-sys 0.52.0",
] ]
[[package]] [[package]]
@ -3288,15 +3108,6 @@ dependencies = [
"cpufeatures", "cpufeatures",
] ]
[[package]]
name = "kv-log-macro"
version = "1.0.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0de8b303297635ad57c9f5059fd9cee7a47f8e8daa09df0fcd07dd39fb22977f"
dependencies = [
"log",
]
[[package]] [[package]]
name = "lazy_static" name = "lazy_static"
version = "1.5.0" version = "1.5.0"
@ -3457,7 +3268,7 @@ version = "0.48.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d558548fa3b5a8e9b66392f785921e363c57c05dcadfda4db0d41ae82d313e4a" checksum = "d558548fa3b5a8e9b66392f785921e363c57c05dcadfda4db0d41ae82d313e4a"
dependencies = [ dependencies = [
"async-channel 2.5.0", "async-channel",
"asynchronous-codec", "asynchronous-codec",
"base64", "base64",
"byteorder", "byteorder",
@ -3665,7 +3476,6 @@ version = "0.46.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "803399b4b6f68adb85e63ab573ac568154b193e9a640f03e0f2890eabbcb37f8" checksum = "803399b4b6f68adb85e63ab573ac568154b193e9a640f03e0f2890eabbcb37f8"
dependencies = [ dependencies = [
"async-std",
"either", "either",
"fnv", "fnv",
"futures", "futures",
@ -3719,7 +3529,6 @@ version = "0.43.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "65346fb4d36035b23fec4e7be4c320436ba53537ce9b6be1d1db1f70c905cad0" checksum = "65346fb4d36035b23fec4e7be4c320436ba53537ce9b6be1d1db1f70c905cad0"
dependencies = [ dependencies = [
"async-io",
"futures", "futures",
"futures-timer", "futures-timer",
"if-watch", "if-watch",
@ -3867,9 +3676,6 @@ name = "log"
version = "0.4.29" version = "0.4.29"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5e5032e24019045c762d3c0f28f5b6b8bbf38563a65908389bf7978758920897" checksum = "5e5032e24019045c762d3c0f28f5b6b8bbf38563a65908389bf7978758920897"
dependencies = [
"value-bag",
]
[[package]] [[package]]
name = "logos-blockchain-blend-crypto" name = "logos-blockchain-blend-crypto"
@ -3882,7 +3688,7 @@ dependencies = [
"logos-blockchain-utils", "logos-blockchain-utils",
"num-bigint", "num-bigint",
"rs-merkle-tree", "rs-merkle-tree",
"thiserror 1.0.69", "thiserror 2.0.18",
] ]
[[package]] [[package]]
@ -3898,12 +3704,13 @@ dependencies = [
"logos-blockchain-core", "logos-blockchain-core",
"logos-blockchain-groth16", "logos-blockchain-groth16",
"logos-blockchain-key-management-system-keys", "logos-blockchain-key-management-system-keys",
"logos-blockchain-log-targets",
"logos-blockchain-utils", "logos-blockchain-utils",
"serde", "serde",
"serde-big-array", "serde-big-array",
"serde_with", "serde_with",
"test-log", "test-log",
"thiserror 1.0.69", "thiserror 2.0.18",
"tracing", "tracing",
"zeroize", "zeroize",
] ]
@ -3922,10 +3729,11 @@ dependencies = [
"logos-blockchain-key-management-system-keys", "logos-blockchain-key-management-system-keys",
"logos-blockchain-pol", "logos-blockchain-pol",
"logos-blockchain-poq", "logos-blockchain-poq",
"logos-blockchain-poseidon2",
"logos-blockchain-utils", "logos-blockchain-utils",
"num-bigint", "num-bigint",
"serde", "serde",
"thiserror 1.0.69", "thiserror 2.0.18",
"zeroize", "zeroize",
] ]
@ -3950,6 +3758,7 @@ version = "0.2.1"
dependencies = [ dependencies = [
"async-trait", "async-trait",
"bytes", "bytes",
"derivative",
"futures", "futures",
"logos-blockchain-chain-broadcast-service", "logos-blockchain-chain-broadcast-service",
"logos-blockchain-core", "logos-blockchain-core",
@ -3965,14 +3774,14 @@ dependencies = [
"logos-blockchain-tracing", "logos-blockchain-tracing",
"logos-blockchain-utils", "logos-blockchain-utils",
"logos-blockchain-utxotree", "logos-blockchain-utxotree",
"num-bigint",
"overwatch", "overwatch",
"rand 0.8.5", "rand 0.8.5",
"serde", "serde",
"serde_with", "serde_with",
"strum 0.27.2", "strum 0.27.2",
"tempfile", "tempfile",
"thiserror 1.0.69", "thiserror 2.0.18",
"time",
"tokio", "tokio",
"tracing", "tracing",
"tracing-futures", "tracing-futures",
@ -4000,6 +3809,7 @@ version = "0.2.1"
dependencies = [ dependencies = [
"futures", "futures",
"hex", "hex",
"log",
"logos-blockchain-chain-broadcast-service", "logos-blockchain-chain-broadcast-service",
"logos-blockchain-chain-service", "logos-blockchain-chain-service",
"logos-blockchain-core", "logos-blockchain-core",
@ -4009,7 +3819,8 @@ dependencies = [
"reqwest", "reqwest",
"serde", "serde",
"serde_json", "serde_json",
"thiserror 1.0.69", "thiserror 2.0.18",
"tokio-util",
"url", "url",
] ]
@ -4030,6 +3841,7 @@ dependencies = [
"logos-blockchain-cryptarchia-engine", "logos-blockchain-cryptarchia-engine",
"logos-blockchain-groth16", "logos-blockchain-groth16",
"logos-blockchain-key-management-system-keys", "logos-blockchain-key-management-system-keys",
"logos-blockchain-mmr",
"logos-blockchain-poc", "logos-blockchain-poc",
"logos-blockchain-pol", "logos-blockchain-pol",
"logos-blockchain-poseidon2", "logos-blockchain-poseidon2",
@ -4039,10 +3851,12 @@ dependencies = [
"nom 8.0.0", "nom 8.0.0",
"num-bigint", "num-bigint",
"rand 0.8.5", "rand 0.8.5",
"rpds",
"serde", "serde",
"serde_json", "serde_json",
"strum 0.27.2", "strum 0.27.2",
"thiserror 1.0.69", "thiserror 2.0.18",
"time",
"tokio", "tokio",
"tracing", "tracing",
] ]
@ -4051,12 +3865,11 @@ dependencies = [
name = "logos-blockchain-cryptarchia-engine" name = "logos-blockchain-cryptarchia-engine"
version = "0.2.1" version = "0.2.1"
dependencies = [ dependencies = [
"cfg_eval",
"logos-blockchain-pol", "logos-blockchain-pol",
"logos-blockchain-utils", "logos-blockchain-utils",
"serde", "serde",
"serde_with", "serde_with",
"thiserror 1.0.69", "thiserror 2.0.18",
"time", "time",
"tokio", "tokio",
"tracing", "tracing",
@ -4076,7 +3889,7 @@ dependencies = [
"rand 0.8.5", "rand 0.8.5",
"serde", "serde",
"serde_with", "serde_with",
"thiserror 1.0.69", "thiserror 2.0.18",
"tokio", "tokio",
"tracing", "tracing",
] ]
@ -4130,8 +3943,11 @@ dependencies = [
"logos-blockchain-utils", "logos-blockchain-utils",
"logos-blockchain-zksign", "logos-blockchain-zksign",
"num-bigint", "num-bigint",
"rand 0.8.5",
"rand_core 0.6.4", "rand_core 0.6.4",
"serde", "serde",
"serde_json",
"serde_yaml",
"subtle", "subtle",
"thiserror 2.0.18", "thiserror 2.0.18",
"tokio", "tokio",
@ -4196,6 +4012,7 @@ dependencies = [
"logos-blockchain-cryptarchia-engine", "logos-blockchain-cryptarchia-engine",
"logos-blockchain-groth16", "logos-blockchain-groth16",
"logos-blockchain-key-management-system-keys", "logos-blockchain-key-management-system-keys",
"logos-blockchain-mmr",
"logos-blockchain-pol", "logos-blockchain-pol",
"logos-blockchain-utils", "logos-blockchain-utils",
"logos-blockchain-utxotree", "logos-blockchain-utxotree",
@ -4204,7 +4021,7 @@ dependencies = [
"rpds", "rpds",
"serde", "serde",
"serde_arrays", "serde_arrays",
"thiserror 1.0.69", "thiserror 2.0.18",
"tracing", "tracing",
] ]
@ -4231,13 +4048,43 @@ dependencies = [
"serde", "serde",
"serde_json", "serde_json",
"serde_with", "serde_with",
"thiserror 1.0.69", "thiserror 2.0.18",
"tokio", "tokio",
"tracing", "tracing",
"tracing-subscriber 0.3.23", "tracing-subscriber 0.3.23",
"zerocopy", "zerocopy",
] ]
[[package]]
name = "logos-blockchain-log-targets"
version = "0.2.1"
dependencies = [
"logos-blockchain-log-targets-macros",
]
[[package]]
name = "logos-blockchain-log-targets-macros"
version = "0.2.1"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.117",
]
[[package]]
name = "logos-blockchain-mmr"
version = "0.2.1"
dependencies = [
"ark-ff 0.4.2",
"logos-blockchain-groth16",
"logos-blockchain-poseidon2",
"proptest",
"proptest-macro",
"rpds",
"serde",
"thiserror 2.0.18",
]
[[package]] [[package]]
name = "logos-blockchain-network-service" name = "logos-blockchain-network-service"
version = "0.2.1" version = "0.2.1"
@ -4268,11 +4115,11 @@ dependencies = [
"logos-blockchain-circuits-prover", "logos-blockchain-circuits-prover",
"logos-blockchain-circuits-utils", "logos-blockchain-circuits-utils",
"logos-blockchain-groth16", "logos-blockchain-groth16",
"logos-blockchain-proofs-error",
"logos-blockchain-witness-generator", "logos-blockchain-witness-generator",
"num-bigint", "num-bigint",
"serde", "serde",
"serde_json", "serde_json",
"thiserror 2.0.18",
"tracing", "tracing",
] ]
@ -4284,13 +4131,13 @@ dependencies = [
"logos-blockchain-circuits-prover", "logos-blockchain-circuits-prover",
"logos-blockchain-circuits-utils", "logos-blockchain-circuits-utils",
"logos-blockchain-groth16", "logos-blockchain-groth16",
"logos-blockchain-proofs-error",
"logos-blockchain-utils", "logos-blockchain-utils",
"logos-blockchain-witness-generator", "logos-blockchain-witness-generator",
"num-bigint", "num-bigint",
"num-traits", "num-traits",
"serde", "serde",
"serde_json", "serde_json",
"thiserror 2.0.18",
"tracing", "tracing",
] ]
@ -4302,6 +4149,7 @@ dependencies = [
"logos-blockchain-circuits-utils", "logos-blockchain-circuits-utils",
"logos-blockchain-groth16", "logos-blockchain-groth16",
"logos-blockchain-pol", "logos-blockchain-pol",
"logos-blockchain-proofs-error",
"logos-blockchain-utils", "logos-blockchain-utils",
"logos-blockchain-witness-generator", "logos-blockchain-witness-generator",
"num-bigint", "num-bigint",
@ -4321,6 +4169,15 @@ dependencies = [
"num-bigint", "num-bigint",
] ]
[[package]]
name = "logos-blockchain-proofs-error"
version = "0.2.1"
dependencies = [
"logos-blockchain-groth16",
"serde_json",
"thiserror 2.0.18",
]
[[package]] [[package]]
name = "logos-blockchain-services-utils" name = "logos-blockchain-services-utils"
version = "0.2.1" version = "0.2.1"
@ -4332,7 +4189,7 @@ dependencies = [
"overwatch-derive", "overwatch-derive",
"serde", "serde",
"serde_json", "serde_json",
"thiserror 1.0.69", "thiserror 2.0.18",
"tokio", "tokio",
"tracing", "tracing",
] ]
@ -4351,7 +4208,7 @@ dependencies = [
"rocksdb", "rocksdb",
"serde", "serde",
"tempfile", "tempfile",
"thiserror 1.0.69", "thiserror 2.0.18",
"tokio", "tokio",
"tracing", "tracing",
] ]
@ -4361,7 +4218,6 @@ name = "logos-blockchain-time-service"
version = "0.2.1" version = "0.2.1"
dependencies = [ dependencies = [
"async-trait", "async-trait",
"cfg_eval",
"futures", "futures",
"log", "log",
"logos-blockchain-cryptarchia-engine", "logos-blockchain-cryptarchia-engine",
@ -4382,6 +4238,8 @@ dependencies = [
name = "logos-blockchain-tracing" name = "logos-blockchain-tracing"
version = "0.2.1" version = "0.2.1"
dependencies = [ dependencies = [
"flate2",
"logos-blockchain-log-targets",
"opentelemetry", "opentelemetry",
"opentelemetry-appender-tracing", "opentelemetry-appender-tracing",
"opentelemetry-http", "opentelemetry-http",
@ -4391,6 +4249,7 @@ dependencies = [
"rand 0.8.5", "rand 0.8.5",
"serde", "serde",
"tokio", "tokio",
"tonic",
"tracing", "tracing",
"tracing-appender", "tracing-appender",
"tracing-gelf", "tracing-gelf",
@ -4417,6 +4276,9 @@ dependencies = [
"serde", "serde",
"serde_json", "serde_json",
"serde_with", "serde_with",
"serde_yaml",
"tempfile",
"thiserror 2.0.18",
"time", "time",
"tokio", "tokio",
] ]
@ -4431,10 +4293,10 @@ dependencies = [
"num-bigint", "num-bigint",
"quickcheck", "quickcheck",
"quickcheck_macros", "quickcheck_macros",
"rand 0.9.2", "rand 0.8.5",
"rpds", "rpds",
"serde", "serde",
"thiserror 1.0.69", "thiserror 2.0.18",
] ]
[[package]] [[package]]
@ -4452,6 +4314,7 @@ dependencies = [
"logos-blockchain-circuits-utils", "logos-blockchain-circuits-utils",
"logos-blockchain-groth16", "logos-blockchain-groth16",
"logos-blockchain-poseidon2", "logos-blockchain-poseidon2",
"logos-blockchain-proofs-error",
"logos-blockchain-witness-generator", "logos-blockchain-witness-generator",
"num-bigint", "num-bigint",
"rand 0.8.5", "rand 0.8.5",
@ -4467,10 +4330,13 @@ version = "0.2.1"
dependencies = [ dependencies = [
"async-trait", "async-trait",
"futures", "futures",
"hex",
"logos-blockchain-common-http-client", "logos-blockchain-common-http-client",
"logos-blockchain-core", "logos-blockchain-core",
"logos-blockchain-groth16",
"logos-blockchain-key-management-system-service", "logos-blockchain-key-management-system-service",
"num-bigint", "num-bigint",
"rand 0.8.5",
"reqwest", "reqwest",
"rpds", "rpds",
"serde", "serde",
@ -4840,7 +4706,6 @@ version = "0.8.8"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cd6c30ed10fa69cc491d491b85cc971f6bdeb8e7367b7cde2ee6cc878d583fae" checksum = "cd6c30ed10fa69cc491d491b85cc971f6bdeb8e7367b7cde2ee6cc878d583fae"
dependencies = [ dependencies = [
"async-io",
"bytes", "bytes",
"futures-util", "futures-util",
"libc", "libc",
@ -4933,7 +4798,7 @@ version = "0.50.3"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7957b9740744892f114936ab4a57b3f487491bbeafaf8083688b16841a4240e5" checksum = "7957b9740744892f114936ab4a57b3f487491bbeafaf8083688b16841a4240e5"
dependencies = [ dependencies = [
"windows-sys 0.61.2", "windows-sys 0.59.0",
] ]
[[package]] [[package]]
@ -5254,7 +5119,7 @@ name = "overwatch-derive"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/logos-co/Overwatch?rev=448c192#448c192895b8311c742b1726a1bb12ee314ad95c" source = "git+https://github.com/logos-co/Overwatch?rev=448c192#448c192895b8311c742b1726a1bb12ee314ad95c"
dependencies = [ dependencies = [
"convert_case", "convert_case 0.8.0",
"proc-macro-error2", "proc-macro-error2",
"proc-macro2", "proc-macro2",
"quote", "quote",
@ -5349,23 +5214,6 @@ version = "0.2.17"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a89322df9ebe1c1578d689c92318e070967d1042b512afbe49518723f4e6d5cd" checksum = "a89322df9ebe1c1578d689c92318e070967d1042b512afbe49518723f4e6d5cd"
[[package]]
name = "pin-utils"
version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184"
[[package]]
name = "piper"
version = "0.2.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c835479a4443ded371d6c535cbfd8d31ad92c5d23ae9770a61bc155e4992a3c1"
dependencies = [
"atomic-waker",
"fastrand",
"futures-io",
]
[[package]] [[package]]
name = "pkcs8" name = "pkcs8"
version = "0.10.2" version = "0.10.2"
@ -5621,9 +5469,22 @@ dependencies = [
"rand 0.9.2", "rand 0.9.2",
"rand_chacha 0.9.0", "rand_chacha 0.9.0",
"rand_xorshift", "rand_xorshift",
"regex-syntax",
"unarray", "unarray",
] ]
[[package]]
name = "proptest-macro"
version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c7b009e4051fac51cd34053b7e33a7dbda87a79f1548fdb00f3f35a4b32bac91"
dependencies = [
"convert_case 0.6.0",
"proc-macro2",
"quote",
"syn 2.0.117",
]
[[package]] [[package]]
name = "prost" name = "prost"
version = "0.13.5" version = "0.13.5"
@ -6236,7 +6097,6 @@ version = "0.20.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4b960d5d873a75b5be9761b1e73b146f52dddcd27bac75263f40fba686d4d7b5" checksum = "4b960d5d873a75b5be9761b1e73b146f52dddcd27bac75263f40fba686d4d7b5"
dependencies = [ dependencies = [
"async-global-executor",
"futures-channel", "futures-channel",
"futures-util", "futures-util",
"log", "log",
@ -6331,7 +6191,7 @@ dependencies = [
"errno", "errno",
"libc", "libc",
"linux-raw-sys 0.12.1", "linux-raw-sys 0.12.1",
"windows-sys 0.61.2", "windows-sys 0.52.0",
] ]
[[package]] [[package]]
@ -6648,23 +6508,6 @@ version = "1.15.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "67b1b7a3b5fe4f1376887184045fcf45c69e92af734b7aaddc05fb777b6fbd03" checksum = "67b1b7a3b5fe4f1376887184045fcf45c69e92af734b7aaddc05fb777b6fbd03"
[[package]]
name = "smol"
version = "2.0.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a33bd3e260892199c3ccfc487c88b2da2265080acb316cd920da72fdfd7c599f"
dependencies = [
"async-channel 2.5.0",
"async-executor",
"async-fs",
"async-io",
"async-lock",
"async-net",
"async-process",
"blocking",
"futures-lite",
]
[[package]] [[package]]
name = "snap" name = "snap"
version = "1.1.1" version = "1.1.1"
@ -6698,7 +6541,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3a766e1110788c36f4fa1c2b71b387a7815aa65f88ce0229841826633d93723e" checksum = "3a766e1110788c36f4fa1c2b71b387a7815aa65f88ce0229841826633d93723e"
dependencies = [ dependencies = [
"libc", "libc",
"windows-sys 0.61.2", "windows-sys 0.60.2",
] ]
[[package]] [[package]]
@ -6863,6 +6706,12 @@ dependencies = [
"symbolic-common", "symbolic-common",
] ]
[[package]]
name = "symlink"
version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a7973cce6668464ea31f176d85b13c7ab3bba2cb3b77a2ed26abd7801688010a"
[[package]] [[package]]
name = "syn" name = "syn"
version = "1.0.109" version = "1.0.109"
@ -6953,7 +6802,7 @@ dependencies = [
"getrandom 0.4.2", "getrandom 0.4.2",
"once_cell", "once_cell",
"rustix 1.1.4", "rustix 1.1.4",
"windows-sys 0.61.2", "windows-sys 0.52.0",
] ]
[[package]] [[package]]
@ -7294,11 +7143,12 @@ dependencies = [
[[package]] [[package]]
name = "tracing-appender" name = "tracing-appender"
version = "0.2.4" version = "0.2.5"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "786d480bce6247ab75f005b14ae1624ad978d3029d9113f0a22fa1ac773faeaf" checksum = "050686193eb999b4bb3bc2acfa891a13da00f79734704c4b8b4ef1a10b368a3c"
dependencies = [ dependencies = [
"crossbeam-channel", "crossbeam-channel",
"symlink",
"thiserror 2.0.18", "thiserror 2.0.18",
"time", "time",
"tracing-subscriber 0.3.23", "tracing-subscriber 0.3.23",
@ -7637,12 +7487,6 @@ version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ba73ea9cf16a25df0c8caa16c51acb937d5712a8429db78a3ee29d5dcacd3a65" checksum = "ba73ea9cf16a25df0c8caa16c51acb937d5712a8429db78a3ee29d5dcacd3a65"
[[package]]
name = "value-bag"
version = "1.12.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7ba6f5989077681266825251a52748b8c1d8a4ad098cc37e440103d0ea717fc0"
[[package]] [[package]]
name = "vcpkg" name = "vcpkg"
version = "0.2.15" version = "0.2.15"
@ -7875,7 +7719,7 @@ version = "0.1.11"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c2a7b1c03c876122aa43f3020e6c3c3ee5c05081c9a00739faf7503aeba10d22" checksum = "c2a7b1c03c876122aa43f3020e6c3c3ee5c05081c9a00739faf7503aeba10d22"
dependencies = [ dependencies = [
"windows-sys 0.61.2", "windows-sys 0.52.0",
] ]
[[package]] [[package]]

View File

@ -85,6 +85,10 @@ quote = { default-features = false, version = "1" }
syn = { features = ["full"], version = "2" } syn = { features = ["full"], version = "2" }
tonic = { default-features = false, version = "0.14.5" } tonic = { default-features = false, version = "0.14.5" }
lb-zone-sdk = { default-features = false, package = "logos-blockchain-zone-sdk", path = "./logos-blockchain/zone-sdk" } lb-zone-sdk = { default-features = false, package = "logos-blockchain-zone-sdk", path = "./logos-blockchain/zone-sdk" }
lb-config = { default-features = false, package = "logos-blockchain-config", path = "./logos-blockchain/tools/config" }
lb-tools = { default-features = false, package = "logos-blockchain-tools", path = "./logos-blockchain/tools/blockchain-tools" }
lb-tui-zone = { default-features = false, package = "logos-blockchain-tui-zone", path = "./logos-blockchain/testnet/tui-zone" }
lbp-error = { default-features = false, package = "logos-blockchain-proofs-error", path = "./logos-blockchain/zk/proofs/error" }
lb_network = { default-features = false, package = "logos-blockchain-network-service", path = "./logos-blockchain/services/network" } lb_network = { default-features = false, package = "logos-blockchain-network-service", path = "./logos-blockchain/services/network" }
testing-framework-core = { default-features = false, git = "https://github.com/logos-blockchain/logos-blockchain-testing.git", rev = "f731791" } testing-framework-core = { default-features = false, git = "https://github.com/logos-blockchain/logos-blockchain-testing.git", rev = "f731791" }
testing-framework-runner-compose = { default-features = false, git = "https://github.com/logos-blockchain/logos-blockchain-testing.git", rev = "f731791" } testing-framework-runner-compose = { default-features = false, git = "https://github.com/logos-blockchain/logos-blockchain-testing.git", rev = "f731791" }
@ -109,7 +113,90 @@ libp2p-stream = { default-features = false, version = "0.3.0-alpha" }
log = { default-features = false, version = "0.4" } log = { default-features = false, version = "0.4" }
overwatch = { default-features = false, git = "https://github.com/logos-co/Overwatch", rev = "448c192" } overwatch = { default-features = false, git = "https://github.com/logos-co/Overwatch", rev = "448c192" }
overwatch-derive = { default-features = false, git = "https://github.com/logos-co/Overwatch", rev = "448c192" } overwatch-derive = { default-features = false, git = "https://github.com/logos-co/Overwatch", rev = "448c192" }
anyhow = { default-features = false, version = "1" }
ark-bn254 = { default-features = false, version = "0.4" }
ark-ec = { default-features = false, version = "0.4" }
ark-ff = { default-features = false, version = "0.4" }
ark-groth16 = { default-features = false, version = "0.4" }
ark-serialize = { default-features = false, version = "0.4.2" }
astro-float = { default-features = false, version = "0.9" }
async-ctrlc = { default-features = false, version = "1.2" }
async-stream = { default-features = false, version = "0.3.6" }
axum = { default-features = false, version = "0.7.5" }
backon = { default-features = false, version = "1.3.0" }
bincode = { default-features = false, version = "1.3" }
chrono = { default-features = false, version = "0.4" }
cipher = { default-features = false, version = "0.4" }
clap = { default-features = false, version = "4" }
color-eyre = { default-features = false, version = "0.6.0" }
console-subscriber = { default-features = false, version = "0.4" }
const-hex = { default-features = false, version = "1" }
cucumber = { default-features = false, version = "=0.22.0" }
derivative = { default-features = false, version = "2" }
dhat = { default-features = false, version = "0.3.3" }
dirs = { default-features = false, version = "6.0" }
ed25519 = { default-features = false, version = "2.2.3" }
either = { default-features = false, version = "1.15.0" }
flate2 = { default-features = false, version = "1.1.9" }
futures-timer = { default-features = false, version = "3.0.3" }
generic-array = { default-features = false, version = "1.2" }
hasher = { default-features = false, version = "0.1.4" }
http = { default-features = false, version = "1.3" }
humantime = { default-features = false, version = "2.1" }
hyper = { default-features = false, version = "1.0" }
igd-next = { default-features = false, version = "0.16.1" }
itertools = { default-features = false, version = "0.14" }
jf-poseidon2 = { default-features = false, git = "https://github.com/EspressoSystems/jellyfish.git", rev = "dc166cf0f803c3e5067f9dfcc21e3dade986a447" }
libp2p-swarm-test = { default-features = false, version = "0.5" }
multiaddr = { default-features = false, version = "0.18" }
natpmp = { default-features = false, version = "0.5" }
netdev = { default-features = false, version = "0.31" }
nistrs = { default-features = false, version = "0.1.2" }
nom = { default-features = false, version = "8" }
num_enum = { default-features = false, version = "0.7.4" }
num-bigint = { default-features = false, version = "0.4" }
num-traits = { default-features = false, version = "0.2.19" }
opentelemetry = { default-features = false, version = "0.31" }
opentelemetry-appender-tracing = { default-features = false, version = "0.31" }
opentelemetry-http = { default-features = false, version = "0.31" }
opentelemetry-otlp = { default-features = false, version = "0.31" }
opentelemetry_sdk = { default-features = false, version = "0.31" }
opentelemetry-semantic-conventions = { default-features = false, version = "0.31" }
owo-colors = { default-features = false, version = "4.2.3" }
pprof = { default-features = false, version = "0.15" }
proptest = { default-features = false, version = "1.0" }
proptest-macro = { default-features = false, version = "0.2" }
quickcheck = { default-features = false, version = "1.0" }
quickcheck_macros = { default-features = false, version = "1.0" }
rand_chacha = { default-features = false, version = "0.3" }
rand_core = { default-features = false, version = "0.6.4" }
rand = { default-features = false, version = "0.8" } rand = { default-features = false, version = "0.8" }
redb = { default-features = false, version = "2.2" }
rocksdb = { default-features = false, version = "0.24" }
rpds = { default-features = false, version = "1" }
rs-merkle-tree = { default-features = false, version = "0.1" }
serde_arrays = { default-features = false, version = "0.2.0" }
serde_path_to_error = { default-features = false, version = "0.1" }
serde_yml = { default-features = false, version = "0.0.12" }
serial_test = { default-features = false, version = "3.1.1" }
sntpc = { default-features = false, version = "0.5" }
strum = { default-features = false, version = "0.27" }
strum_macros = { default-features = false, version = "0.27.2" }
sysinfo = { default-features = false, version = "0.37" }
test-log = { default-features = false, version = "0.2" }
tikv-jemallocator = { default-features = false, version = "0.6" }
tokio-util = { default-features = false, version = "0.7" }
tower = { default-features = false, version = "0.4" }
tower-http = { default-features = false, version = "0.6.8" }
tracing-appender = { default-features = false, version = "0.2" }
tracing-futures = { default-features = false, version = "0.2" }
tracing-gelf = { default-features = false, version = "0.7" }
tracing-loki = { default-features = false, version = "0.2.5" }
tracing-opentelemetry = { default-features = false, version = "0.32.1" }
tracing-subscriber = { default-features = false, version = "0.3" }
url = { default-features = false, version = "2" }
validator = { default-features = false, version = "0.20.0" }
zerocopy = { default-features = false, version = "0.8.26" }
reqwest = { default-features = false, version = "0.12" } reqwest = { default-features = false, version = "0.12" }
serde = { default-features = false, version = "1.0" } serde = { default-features = false, version = "1.0" }
serde-big-array = { default-features = false, version = "0.5" } serde-big-array = { default-features = false, version = "0.5" }

View File

@ -20,7 +20,8 @@ chacha20poly1305 = { features = ["std"], version = "0.10" }
chrono = { features = ["serde"], version = "0.4" } chrono = { features = ["serde"], version = "0.4" }
crypto-common = { features = ["std"], version = "0.1.6" } crypto-common = { features = ["std"], version = "0.1.6" }
directories = "6.0" directories = "6.0"
logos-blockchain-zone-sdk = { path = "../logos-blockchain/zone-sdk" } lb-core = { workspace = true }
lb-zone-sdk = { package = "logos-blockchain-zone-sdk", path = "../logos-blockchain/zone-sdk" }
nanosql = { features = ["chrono"], version = "0.10.0" } nanosql = { features = ["chrono"], version = "0.10.0" }
rand = { version = "0.9" } rand = { version = "0.9" }
ratatui = { features = ["serde"], version = "0.29" } ratatui = { features = ["serde"], version = "0.29" }

View File

@ -12,7 +12,7 @@ use argon2::Error as Argon2Error;
use block_padding::UnpadError; use block_padding::UnpadError;
use chacha20poly1305::Error as XChaCha20Poly1305Error; use chacha20poly1305::Error as XChaCha20Poly1305Error;
use crypto_common::InvalidLength; use crypto_common::InvalidLength;
use logos_blockchain_zone_sdk::indexer::Error as ZoneIndexerError; use lb_zone_sdk::indexer::Error as ZoneIndexerError;
use nanosql::{Error as SqlError, rusqlite::Error as RusqliteError}; use nanosql::{Error as SqlError, rusqlite::Error as RusqliteError};
use serde_json::Error as JsonError; use serde_json::Error as JsonError;
use thiserror::Error; use thiserror::Error;

View File

@ -4,4 +4,6 @@ pub mod config;
pub mod crypto; pub mod crypto;
pub mod error; pub mod error;
pub mod logging; pub mod logging;
pub mod message;
pub mod screen; pub mod screen;
pub mod state;

48
common/src/message.rs Normal file
View File

@ -0,0 +1,48 @@
use lb_core::mantle::ops::channel::MsgId;
use serde::{Deserialize, Serialize};
use uuid::Uuid;
/// Application-level message wrapper. `tx_uuid` ensures unique payload to
/// avoid mempool deduplication even with same signing keys in decentralized
/// scenarios.
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct AppMessage {
pub tx_uuid: Uuid,
pub text: String,
}
impl AppMessage {
pub fn new(text: String) -> Self {
Self {
tx_uuid: Uuid::new_v4(),
text,
}
}
pub fn to_bytes(&self) -> Vec<u8> {
serde_json::to_vec(self).expect("AppMessage serialization should not fail")
}
pub fn from_bytes(bytes: &[u8]) -> Option<Self> {
serde_json::from_slice(bytes).ok()
}
}
/// A single message tracked by the TUI.
///
/// `msg_id` is SDK-provided lineage anchor; `text` is the app-level text
/// extracted from the JSON-encoded payload (falls back to raw UTF-8 for
/// payloads that didn't come from this TUI).
#[derive(Debug, Clone)]
pub struct Msg {
pub msg_id: MsgId,
pub text: String,
}
impl Msg {
pub fn from_payload(msg_id: MsgId, payload: &[u8]) -> Self {
let text = AppMessage::from_bytes(payload)
.map_or_else(|| String::from_utf8_lossy(payload).into_owned(), |m| m.text);
Self { msg_id, text }
}
}

106
common/src/state.rs Normal file
View File

@ -0,0 +1,106 @@
use lb_core::mantle::ops::channel::MsgId;
use lb_zone_sdk::{sequencer::SequencerCheckpoint, state::InscriptionInfo};
use crate::message::Msg;
/// Trait for the TUI's view of zone state.
///
/// The TUI feeds SDK events into this trait; the trait owns persistence.
/// `InMemoryZoneState` is the demo implementation. A real sequencer would
/// implement it over a DB so `published`/`adopted`/`finalized` survive
/// restarts (the SDK's own checkpoint covers tx-level resume separately).
///
/// Three lists, each ordered by arrival:
/// - `published`: our submissions, in submit order, until they finalize or get
/// orphaned.
/// - `adopted`: others' inscriptions on canonical, deduped by `msg_id` (reorgs
/// can re-adopt the same one), in first-sighting order.
/// - `finalized`: all inscriptions below LIB, in canonical order — the SDK
/// delivers `TxsFinalized`/`FinalizedInscriptions` per block.
///
/// Replay-idempotent: `on_adopted` and `on_finalized` dedup by `msg_id`, so
/// resuming from a persisted state and re-receiving backfill is harmless.
pub trait ZoneState: Send {
fn on_published(&mut self, info: &InscriptionInfo);
fn on_adopted(&mut self, adopted: &[InscriptionInfo]);
/// Remove our orphaned entry from `published`. Caller is expected to
/// auto-republish via `handle.publish_message`.
fn on_orphaned(&mut self, msg_id: &MsgId);
fn on_finalized(&mut self, inscriptions: &[InscriptionInfo]);
fn published(&self) -> &[Msg];
fn adopted(&self) -> &[Msg];
fn finalized(&self) -> &[Msg];
fn save_checkpoint(&mut self, checkpoint: SequencerCheckpoint);
fn load_checkpoint(&self) -> Option<&SequencerCheckpoint>;
}
/// In-memory implementation of [`ZoneState`].
#[derive(Default)]
pub struct InMemoryZoneState {
published: Vec<Msg>,
adopted: Vec<Msg>,
finalized: Vec<Msg>,
checkpoint: Option<SequencerCheckpoint>,
}
impl ZoneState for InMemoryZoneState {
fn on_published(&mut self, info: &InscriptionInfo) {
self.published
.push(Msg::from_payload(info.this_msg, &info.payload));
}
fn on_adopted(&mut self, adopted: &[InscriptionInfo]) {
for info in adopted {
if !self.adopted.iter().any(|m| m.msg_id == info.this_msg) {
self.adopted
.push(Msg::from_payload(info.this_msg, &info.payload));
}
}
}
fn on_orphaned(&mut self, msg_id: &MsgId) {
if let Some(i) = self.published.iter().position(|m| &m.msg_id == msg_id) {
self.published.remove(i);
}
}
fn on_finalized(&mut self, inscriptions: &[InscriptionInfo]) {
for info in inscriptions {
if let Some(i) = self
.published
.iter()
.position(|m| m.msg_id == info.this_msg)
{
self.published.remove(i);
} else if let Some(i) = self.adopted.iter().position(|m| m.msg_id == info.this_msg) {
self.adopted.remove(i);
}
if !self.finalized.iter().any(|m| m.msg_id == info.this_msg) {
self.finalized
.push(Msg::from_payload(info.this_msg, &info.payload));
}
}
}
fn published(&self) -> &[Msg] {
&self.published
}
fn adopted(&self) -> &[Msg] {
&self.adopted
}
fn finalized(&self) -> &[Msg] {
&self.finalized
}
fn save_checkpoint(&mut self, checkpoint: SequencerCheckpoint) {
self.checkpoint = Some(checkpoint);
}
fn load_checkpoint(&self) -> Option<&SequencerCheckpoint> {
self.checkpoint.as_ref()
}
}

View File

@ -82,11 +82,10 @@ impl Indexer {
futures::pin_mut!(stream); futures::pin_mut!(stream);
while let Some(zone_msg) = stream.next().await { while let Some(zone_msg) = stream.next().await {
let data = match zone_msg { let logos_blockchain_zone_sdk::ZoneMessage::Block(zone_block) = zone_msg else {
logos_blockchain_zone_sdk::ZoneMessage::Block(block) => block.data, continue;
logos_blockchain_zone_sdk::ZoneMessage::Deposit(_) => continue,
}; };
let sql_text = match String::from_utf8(data) { let sql_text = match String::from_utf8(zone_block.data) {
Ok(s) => s, Ok(s) => s,
Err(e) => { Err(e) => {
error!("Zone block data is not valid UTF-8: {e}"); error!("Zone block data is not valid UTF-8: {e}");

View File

@ -7,45 +7,35 @@ use std::{
time::Duration, time::Duration,
}; };
use demo_sqlite_common::state::{InMemoryZoneState, ZoneState as _};
use fs2::FileExt as _; use fs2::FileExt as _;
use lb_common_http_client::{BasicAuthCredentials, CommonHttpClient}; use lb_common_http_client::{BasicAuthCredentials, CommonHttpClient};
use lb_core::mantle::ops::channel::ChannelId; use lb_core::mantle::ops::channel::ChannelId;
use lb_key_management_system_service::keys::{ED25519_SECRET_KEY_SIZE, Ed25519Key}; use lb_key_management_system_service::keys::{ED25519_SECRET_KEY_SIZE, Ed25519Key};
use logos_blockchain_zone_sdk::adapter::NodeHttpClient; use logos_blockchain_zone_sdk::{
use logos_blockchain_zone_sdk::sequencer::{ adapter::NodeHttpClient,
Error as ZoneSequencerError, SequencerHandle, ZoneSequencer, SequencerCheckpoint, sequencer::{Event, SequencerCheckpoint, SequencerHandle, ZoneSequencer},
}; };
use nanosql::rusqlite::Error as SqliteError;
use reqwest::Url; use reqwest::Url;
use thiserror::Error; use thiserror::Error;
use tokio::time::sleep; use tracing::{debug, error, info};
use tracing::{debug, info};
#[derive(Debug, Error)] #[derive(Debug, Error)]
pub enum SequencerError { pub enum SequencerError {
#[error("Zone sequencer error: {0}")]
ZoneSequencer(#[from] ZoneSequencerError),
#[error("URL parse error: {0}")] #[error("URL parse error: {0}")]
Url(String), Url(String),
#[error("IO error: {0}")] #[error("IO error: {0}")]
Io(#[from] io::Error), Io(#[from] io::Error),
#[error("SQLite error: {0}")]
Sqlite(#[from] SqliteError),
#[error("Invalid key file: expected {expected} bytes, got {actual}")]
InvalidKeyFile { expected: usize, actual: usize },
#[error("{0}")]
InvalidChannelId(String),
#[error("Timeout: {0}")]
Timeout(String),
} }
pub type Result<T> = std::result::Result<T, SequencerError>; pub type Result<T> = std::result::Result<T, SequencerError>;
/// The sequencer that handles transactions using the Zone SDK.
pub struct Sequencer { pub struct Sequencer {
sequencer: ZoneSequencer<NodeHttpClient>,
handle: SequencerHandle<NodeHttpClient>, handle: SequencerHandle<NodeHttpClient>,
state: InMemoryZoneState,
queue_file: String, queue_file: String,
pub checkpoint_path: String, checkpoint_path: String,
} }
fn save_checkpoint(path: &Path, checkpoint: &SequencerCheckpoint) { fn save_checkpoint(path: &Path, checkpoint: &SequencerCheckpoint) {
@ -61,7 +51,6 @@ fn load_checkpoint(path: &Path) -> Option<SequencerCheckpoint> {
Some(serde_json::from_slice(&data).expect("failed to deserialize checkpoint")) Some(serde_json::from_slice(&data).expect("failed to deserialize checkpoint"))
} }
/// Load signing key from file or generate a new one if it doesn't exist.
fn load_or_create_signing_key(path: &Path) -> Ed25519Key { fn load_or_create_signing_key(path: &Path) -> Ed25519Key {
if path.exists() { if path.exists() {
let key_bytes = fs::read(path).expect("failed to read key file"); let key_bytes = fs::read(path).expect("failed to read key file");
@ -103,7 +92,7 @@ impl Sequencer {
} }
} }
let checkpoint = load_checkpoint(Path::new(&checkpoint_path)); let checkpoint = load_checkpoint(Path::new(checkpoint_path));
if checkpoint.is_some() { if checkpoint.is_some() {
println!(" Restored checkpoint from {checkpoint_path}"); println!(" Restored checkpoint from {checkpoint_path}");
} }
@ -114,45 +103,79 @@ impl Sequencer {
.expect("failed to write channel id"); .expect("failed to write channel id");
let node = NodeHttpClient::new(CommonHttpClient::new(basic_auth), node_url); let node = NodeHttpClient::new(CommonHttpClient::new(basic_auth), node_url);
let (zone_sequencer, mut handle) = let (sequencer, handle) = ZoneSequencer::init(channel_id, signing_key, node, checkpoint);
ZoneSequencer::init(channel_id, signing_key, node, checkpoint);
zone_sequencer.spawn();
println!("Connecting to node...");
handle.wait_ready().await;
println!("Sequencer ready.");
Ok(Self { Ok(Self {
sequencer,
handle, handle,
state: InMemoryZoneState::default(),
queue_file: queue_file.to_owned(), queue_file: queue_file.to_owned(),
checkpoint_path: checkpoint_path.to_owned(), checkpoint_path: checkpoint_path.to_owned(),
}) })
} }
/// Drain the queue file and return all pending SQL statements. pub async fn run(self) {
fn queue_drain(&self) -> Result<Vec<String>> { let Self { mut sequencer, handle, mut state, queue_file, checkpoint_path } = self;
let file = OpenOptions::new()
.read(true)
.write(true)
.open(self.queue_file.clone())?;
file.lock_exclusive()?; let mut batch_handle = handle.clone();
tokio::spawn(async move {
batch_handle.wait_ready().await;
let mut interval = tokio::time::interval(Duration::from_millis(100));
loop {
interval.tick().await;
if let Err(e) = process_pending_batch(&queue_file, &batch_handle).await {
error!("Batch processing failed: {e}");
}
}
});
let reader = BufReader::new(&file); loop {
let mut queue_vec = Vec::new(); let Some(event) = sequencer.next_event().await else { break; };
for query in reader.lines() { handle_event(event, &handle, &mut state, &checkpoint_path).await;
queue_vec.push(query?.clone()); }
}
} }
file.set_len(0)?; async fn handle_event(
event: Event,
Ok(queue_vec) handle: &SequencerHandle<NodeHttpClient>,
state: &mut InMemoryZoneState,
checkpoint_path: &str,
) {
match event {
Event::Ready => {
info!("Sequencer ready");
}
Event::ChannelUpdate { orphaned, adopted } => {
state.on_adopted(&adopted);
for info in &orphaned {
state.on_orphaned(&info.this_msg);
debug!(msg_id = %hex::encode(info.this_msg.as_ref()), "Auto-republishing orphan");
if let Err(e) = handle.publish_message(info.payload.clone()).await {
error!("failed to auto-republish: {e}");
}
}
}
Event::TxsFinalized { inscriptions, .. } => {
state.on_finalized(&inscriptions);
}
Event::Published { info, checkpoint } => {
debug!(msg_id = %hex::encode(info.this_msg.as_ref()), "Published");
state.on_published(&info);
save_checkpoint(Path::new(checkpoint_path), &checkpoint);
state.save_checkpoint(checkpoint);
}
Event::FinalizedInscriptions { inscriptions } => {
state.on_finalized(&inscriptions);
}
}
} }
/// Bundle all pending SQL statements into one inscription and publish it. async fn process_pending_batch(
async fn process_pending_batch(&self) -> Result<()> { queue_file: &str,
let pending = self.queue_drain()?; handle: &SequencerHandle<NodeHttpClient>,
) -> Result<()> {
let pending = queue_drain(queue_file)?;
if pending.is_empty() { if pending.is_empty() {
return Ok(()); return Ok(());
} }
@ -161,51 +184,31 @@ impl Sequencer {
debug!("Processing batch of {} queries", count); debug!("Processing batch of {} queries", count);
let sql_text = pending.join("\n").as_bytes().to_vec(); let sql_text = pending.join("\n").as_bytes().to_vec();
if let Err(e) = handle.publish_message(sql_text).await {
match self.handle.publish_message(sql_text).await { error!("failed to publish batch: {e}");
Ok(result) => { } else {
info!("Submitted batch of {} statement(s)", count); info!("Submitted batch of {} statement(s)", count);
save_checkpoint(Path::new(&self.checkpoint_path), &result.checkpoint);
}
Err(e) => {
println!(" error: {e}");
}
} }
Ok(()) Ok(())
} }
/// Check if the queue file is empty. fn queue_drain(queue_file: &str) -> Result<Vec<String>> {
pub fn queue_is_empty(&self) -> Result<bool> { let file = match OpenOptions::new().read(true).write(true).open(queue_file) {
match fs::metadata(self.queue_file.clone()) { Ok(f) => f,
Ok(meta) => Ok(meta.len() == 0), Err(e) if e.kind() == io::ErrorKind::NotFound => return Ok(Vec::new()),
Err(e) if e.kind() == io::ErrorKind::NotFound => Ok(true), Err(e) => return Err(SequencerError::Io(e)),
Err(e) => Err(e.into()),
}
}
/// Background processing loop — call this in a spawned task.
pub async fn run_processing_loop(&self) {
let poll_interval = Duration::from_millis(100);
loop {
let is_empty = match self.queue_is_empty() {
Ok(empty) => empty,
Err(e) => {
tracing::error!("Failed to check queue: {}", e);
sleep(poll_interval).await;
continue;
}
}; };
if is_empty { file.lock_exclusive()?;
sleep(poll_interval).await;
continue; let reader = BufReader::new(&file);
let mut queue_vec = Vec::new();
for query in reader.lines() {
queue_vec.push(query?);
} }
if let Err(e) = self.process_pending_batch().await { file.set_len(0)?;
tracing::error!("Batch processing failed: {}", e);
} Ok(queue_vec)
}
}
} }