feat: upgrade to new zone-sdk

This commit is contained in:
Daniil Polyakov 2026-05-27 00:17:26 +03:00
parent 7055a730bb
commit 53bf8cc726
13 changed files with 340 additions and 292 deletions

275
Cargo.lock generated
View File

@ -733,8 +733,6 @@ checksum = "86887daca11d02e0b04f37a9cb81888aae881397fb48ff66494e356aea97554a"
dependencies = [ dependencies = [
"itertools 0.10.5", "itertools 0.10.5",
"lazy_static", "lazy_static",
"rand 0.8.5",
"serde",
] ]
[[package]] [[package]]
@ -1056,7 +1054,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cffb0e931875b666fc4fcb20fee52e9bbd1ef836fd9e9e04ec21555f9f85f7ef" checksum = "cffb0e931875b666fc4fcb20fee52e9bbd1ef836fd9e9e04ec21555f9f85f7ef"
dependencies = [ dependencies = [
"fastrand", "fastrand",
"gloo-timers 0.3.0",
"tokio", "tokio",
] ]
@ -2189,7 +2186,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]]
@ -2673,7 +2670,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]]
@ -3020,7 +3017,7 @@ version = "3.0.3"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f288b0a4f20f9a56b5d1da57e2227c661b7b16168e2f72365f57b63326e29b24" checksum = "f288b0a4f20f9a56b5d1da57e2227c661b7b16168e2f72365f57b63326e29b24"
dependencies = [ dependencies = [
"gloo-timers 0.2.6", "gloo-timers",
"send_wrapper 0.4.0", "send_wrapper 0.4.0",
] ]
@ -3190,18 +3187,6 @@ dependencies = [
"wasm-bindgen", "wasm-bindgen",
] ]
[[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 = "gloo-utils" name = "gloo-utils"
version = "0.2.0" version = "0.2.0"
@ -5329,7 +5314,7 @@ checksum = "5e5032e24019045c762d3c0f28f5b6b8bbf38563a65908389bf7978758920897"
[[package]] [[package]]
name = "logos-blockchain-blend-crypto" name = "logos-blockchain-blend-crypto"
version = "0.1.2" version = "0.1.2"
source = "git+https://github.com/logos-blockchain/logos-blockchain.git?rev=ee281a447d95a951752461ee0a6e88eb4a0f17cf#ee281a447d95a951752461ee0a6e88eb4a0f17cf" source = "git+https://github.com/logos-blockchain/logos-blockchain.git?rev=dd055cc1ef7c130f710a52a190edd97bc7b0f71b#dd055cc1ef7c130f710a52a190edd97bc7b0f71b"
dependencies = [ dependencies = [
"blake2", "blake2",
"logos-blockchain-groth16", "logos-blockchain-groth16",
@ -5337,13 +5322,13 @@ dependencies = [
"logos-blockchain-poseidon2", "logos-blockchain-poseidon2",
"logos-blockchain-utils", "logos-blockchain-utils",
"rs-merkle-tree", "rs-merkle-tree",
"thiserror 1.0.69", "thiserror 2.0.18",
] ]
[[package]] [[package]]
name = "logos-blockchain-blend-message" name = "logos-blockchain-blend-message"
version = "0.1.2" version = "0.1.2"
source = "git+https://github.com/logos-blockchain/logos-blockchain.git?rev=ee281a447d95a951752461ee0a6e88eb4a0f17cf#ee281a447d95a951752461ee0a6e88eb4a0f17cf" source = "git+https://github.com/logos-blockchain/logos-blockchain.git?rev=dd055cc1ef7c130f710a52a190edd97bc7b0f71b#dd055cc1ef7c130f710a52a190edd97bc7b0f71b"
dependencies = [ dependencies = [
"blake2", "blake2",
"derivative", "derivative",
@ -5354,11 +5339,12 @@ 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",
"thiserror 1.0.69", "thiserror 2.0.18",
"tracing", "tracing",
"zeroize", "zeroize",
] ]
@ -5366,7 +5352,7 @@ dependencies = [
[[package]] [[package]]
name = "logos-blockchain-blend-proofs" name = "logos-blockchain-blend-proofs"
version = "0.1.2" version = "0.1.2"
source = "git+https://github.com/logos-blockchain/logos-blockchain.git?rev=ee281a447d95a951752461ee0a6e88eb4a0f17cf#ee281a447d95a951752461ee0a6e88eb4a0f17cf" source = "git+https://github.com/logos-blockchain/logos-blockchain.git?rev=dd055cc1ef7c130f710a52a190edd97bc7b0f71b#dd055cc1ef7c130f710a52a190edd97bc7b0f71b"
dependencies = [ dependencies = [
"ed25519-dalek", "ed25519-dalek",
"generic-array 1.3.5", "generic-array 1.3.5",
@ -5375,17 +5361,18 @@ dependencies = [
"logos-blockchain-groth16", "logos-blockchain-groth16",
"logos-blockchain-pol", "logos-blockchain-pol",
"logos-blockchain-poq", "logos-blockchain-poq",
"logos-blockchain-poseidon2",
"logos-blockchain-utils", "logos-blockchain-utils",
"num-bigint 0.4.6", "num-bigint 0.4.6",
"serde", "serde",
"thiserror 1.0.69", "thiserror 2.0.18",
"zeroize", "zeroize",
] ]
[[package]] [[package]]
name = "logos-blockchain-chain-broadcast-service" name = "logos-blockchain-chain-broadcast-service"
version = "0.1.2" version = "0.1.2"
source = "git+https://github.com/logos-blockchain/logos-blockchain.git?rev=ee281a447d95a951752461ee0a6e88eb4a0f17cf#ee281a447d95a951752461ee0a6e88eb4a0f17cf" source = "git+https://github.com/logos-blockchain/logos-blockchain.git?rev=dd055cc1ef7c130f710a52a190edd97bc7b0f71b#dd055cc1ef7c130f710a52a190edd97bc7b0f71b"
dependencies = [ dependencies = [
"async-trait", "async-trait",
"derivative", "derivative",
@ -5401,7 +5388,7 @@ dependencies = [
[[package]] [[package]]
name = "logos-blockchain-chain-service" name = "logos-blockchain-chain-service"
version = "0.1.2" version = "0.1.2"
source = "git+https://github.com/logos-blockchain/logos-blockchain.git?rev=ee281a447d95a951752461ee0a6e88eb4a0f17cf#ee281a447d95a951752461ee0a6e88eb4a0f17cf" source = "git+https://github.com/logos-blockchain/logos-blockchain.git?rev=dd055cc1ef7c130f710a52a190edd97bc7b0f71b#dd055cc1ef7c130f710a52a190edd97bc7b0f71b"
dependencies = [ dependencies = [
"async-trait", "async-trait",
"bytes", "bytes",
@ -5423,7 +5410,8 @@ dependencies = [
"serde", "serde",
"serde_with", "serde_with",
"strum", "strum",
"thiserror 1.0.69", "thiserror 2.0.18",
"time",
"tokio", "tokio",
"tracing", "tracing",
"tracing-futures", "tracing-futures",
@ -5432,7 +5420,7 @@ dependencies = [
[[package]] [[package]]
name = "logos-blockchain-circuits-prover" name = "logos-blockchain-circuits-prover"
version = "0.1.2" version = "0.1.2"
source = "git+https://github.com/logos-blockchain/logos-blockchain.git?rev=ee281a447d95a951752461ee0a6e88eb4a0f17cf#ee281a447d95a951752461ee0a6e88eb4a0f17cf" source = "git+https://github.com/logos-blockchain/logos-blockchain.git?rev=dd055cc1ef7c130f710a52a190edd97bc7b0f71b#dd055cc1ef7c130f710a52a190edd97bc7b0f71b"
dependencies = [ dependencies = [
"logos-blockchain-circuits-utils", "logos-blockchain-circuits-utils",
"tempfile", "tempfile",
@ -5441,7 +5429,7 @@ dependencies = [
[[package]] [[package]]
name = "logos-blockchain-circuits-utils" name = "logos-blockchain-circuits-utils"
version = "0.1.2" version = "0.1.2"
source = "git+https://github.com/logos-blockchain/logos-blockchain.git?rev=ee281a447d95a951752461ee0a6e88eb4a0f17cf#ee281a447d95a951752461ee0a6e88eb4a0f17cf" source = "git+https://github.com/logos-blockchain/logos-blockchain.git?rev=dd055cc1ef7c130f710a52a190edd97bc7b0f71b#dd055cc1ef7c130f710a52a190edd97bc7b0f71b"
dependencies = [ dependencies = [
"dirs", "dirs",
] ]
@ -5449,10 +5437,11 @@ dependencies = [
[[package]] [[package]]
name = "logos-blockchain-common-http-client" name = "logos-blockchain-common-http-client"
version = "0.1.2" version = "0.1.2"
source = "git+https://github.com/logos-blockchain/logos-blockchain.git?rev=ee281a447d95a951752461ee0a6e88eb4a0f17cf#ee281a447d95a951752461ee0a6e88eb4a0f17cf" source = "git+https://github.com/logos-blockchain/logos-blockchain.git?rev=dd055cc1ef7c130f710a52a190edd97bc7b0f71b#dd055cc1ef7c130f710a52a190edd97bc7b0f71b"
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",
@ -5462,14 +5451,15 @@ dependencies = [
"reqwest", "reqwest",
"serde", "serde",
"serde_json", "serde_json",
"thiserror 1.0.69", "thiserror 2.0.18",
"tokio-util",
"url", "url",
] ]
[[package]] [[package]]
name = "logos-blockchain-core" name = "logos-blockchain-core"
version = "0.1.2" version = "0.1.2"
source = "git+https://github.com/logos-blockchain/logos-blockchain.git?rev=ee281a447d95a951752461ee0a6e88eb4a0f17cf#ee281a447d95a951752461ee0a6e88eb4a0f17cf" source = "git+https://github.com/logos-blockchain/logos-blockchain.git?rev=dd055cc1ef7c130f710a52a190edd97bc7b0f71b#dd055cc1ef7c130f710a52a190edd97bc7b0f71b"
dependencies = [ dependencies = [
"ark-ff 0.4.2", "ark-ff 0.4.2",
"bincode", "bincode",
@ -5494,20 +5484,21 @@ dependencies = [
"rpds", "rpds",
"serde", "serde",
"strum", "strum",
"thiserror 1.0.69", "thiserror 2.0.18",
"time",
"tracing", "tracing",
] ]
[[package]] [[package]]
name = "logos-blockchain-cryptarchia-engine" name = "logos-blockchain-cryptarchia-engine"
version = "0.1.2" version = "0.1.2"
source = "git+https://github.com/logos-blockchain/logos-blockchain.git?rev=ee281a447d95a951752461ee0a6e88eb4a0f17cf#ee281a447d95a951752461ee0a6e88eb4a0f17cf" source = "git+https://github.com/logos-blockchain/logos-blockchain.git?rev=dd055cc1ef7c130f710a52a190edd97bc7b0f71b#dd055cc1ef7c130f710a52a190edd97bc7b0f71b"
dependencies = [ dependencies = [
"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",
@ -5516,7 +5507,7 @@ dependencies = [
[[package]] [[package]]
name = "logos-blockchain-cryptarchia-sync" name = "logos-blockchain-cryptarchia-sync"
version = "0.1.2" version = "0.1.2"
source = "git+https://github.com/logos-blockchain/logos-blockchain.git?rev=ee281a447d95a951752461ee0a6e88eb4a0f17cf#ee281a447d95a951752461ee0a6e88eb4a0f17cf" source = "git+https://github.com/logos-blockchain/logos-blockchain.git?rev=dd055cc1ef7c130f710a52a190edd97bc7b0f71b#dd055cc1ef7c130f710a52a190edd97bc7b0f71b"
dependencies = [ dependencies = [
"bytes", "bytes",
"futures", "futures",
@ -5527,7 +5518,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",
] ]
@ -5535,7 +5526,7 @@ dependencies = [
[[package]] [[package]]
name = "logos-blockchain-groth16" name = "logos-blockchain-groth16"
version = "0.1.2" version = "0.1.2"
source = "git+https://github.com/logos-blockchain/logos-blockchain.git?rev=ee281a447d95a951752461ee0a6e88eb4a0f17cf#ee281a447d95a951752461ee0a6e88eb4a0f17cf" source = "git+https://github.com/logos-blockchain/logos-blockchain.git?rev=dd055cc1ef7c130f710a52a190edd97bc7b0f71b#dd055cc1ef7c130f710a52a190edd97bc7b0f71b"
dependencies = [ dependencies = [
"ark-bn254 0.4.0", "ark-bn254 0.4.0",
"ark-ec 0.4.2", "ark-ec 0.4.2",
@ -5553,7 +5544,7 @@ dependencies = [
[[package]] [[package]]
name = "logos-blockchain-http-api-common" name = "logos-blockchain-http-api-common"
version = "0.1.2" version = "0.1.2"
source = "git+https://github.com/logos-blockchain/logos-blockchain.git?rev=ee281a447d95a951752461ee0a6e88eb4a0f17cf#ee281a447d95a951752461ee0a6e88eb4a0f17cf" source = "git+https://github.com/logos-blockchain/logos-blockchain.git?rev=dd055cc1ef7c130f710a52a190edd97bc7b0f71b#dd055cc1ef7c130f710a52a190edd97bc7b0f71b"
dependencies = [ dependencies = [
"axum 0.7.9", "axum 0.7.9",
"logos-blockchain-core", "logos-blockchain-core",
@ -5561,14 +5552,19 @@ dependencies = [
"logos-blockchain-tracing", "logos-blockchain-tracing",
"serde", "serde",
"serde_json", "serde_json",
"serde_urlencoded",
"serde_with", "serde_with",
"time",
"tracing", "tracing",
"url",
"utoipa",
"validator",
] ]
[[package]] [[package]]
name = "logos-blockchain-key-management-system-keys" name = "logos-blockchain-key-management-system-keys"
version = "0.1.2" version = "0.1.2"
source = "git+https://github.com/logos-blockchain/logos-blockchain.git?rev=ee281a447d95a951752461ee0a6e88eb4a0f17cf#ee281a447d95a951752461ee0a6e88eb4a0f17cf" source = "git+https://github.com/logos-blockchain/logos-blockchain.git?rev=dd055cc1ef7c130f710a52a190edd97bc7b0f71b#dd055cc1ef7c130f710a52a190edd97bc7b0f71b"
dependencies = [ dependencies = [
"async-trait", "async-trait",
"bytes", "bytes",
@ -5594,7 +5590,7 @@ dependencies = [
[[package]] [[package]]
name = "logos-blockchain-key-management-system-macros" name = "logos-blockchain-key-management-system-macros"
version = "0.1.2" version = "0.1.2"
source = "git+https://github.com/logos-blockchain/logos-blockchain.git?rev=ee281a447d95a951752461ee0a6e88eb4a0f17cf#ee281a447d95a951752461ee0a6e88eb4a0f17cf" source = "git+https://github.com/logos-blockchain/logos-blockchain.git?rev=dd055cc1ef7c130f710a52a190edd97bc7b0f71b#dd055cc1ef7c130f710a52a190edd97bc7b0f71b"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
@ -5604,7 +5600,7 @@ dependencies = [
[[package]] [[package]]
name = "logos-blockchain-key-management-system-operators" name = "logos-blockchain-key-management-system-operators"
version = "0.1.2" version = "0.1.2"
source = "git+https://github.com/logos-blockchain/logos-blockchain.git?rev=ee281a447d95a951752461ee0a6e88eb4a0f17cf#ee281a447d95a951752461ee0a6e88eb4a0f17cf" source = "git+https://github.com/logos-blockchain/logos-blockchain.git?rev=dd055cc1ef7c130f710a52a190edd97bc7b0f71b#dd055cc1ef7c130f710a52a190edd97bc7b0f71b"
dependencies = [ dependencies = [
"async-trait", "async-trait",
"logos-blockchain-blend-proofs", "logos-blockchain-blend-proofs",
@ -5620,7 +5616,7 @@ dependencies = [
[[package]] [[package]]
name = "logos-blockchain-key-management-system-service" name = "logos-blockchain-key-management-system-service"
version = "0.1.2" version = "0.1.2"
source = "git+https://github.com/logos-blockchain/logos-blockchain.git?rev=ee281a447d95a951752461ee0a6e88eb4a0f17cf#ee281a447d95a951752461ee0a6e88eb4a0f17cf" source = "git+https://github.com/logos-blockchain/logos-blockchain.git?rev=dd055cc1ef7c130f710a52a190edd97bc7b0f71b#dd055cc1ef7c130f710a52a190edd97bc7b0f71b"
dependencies = [ dependencies = [
"async-trait", "async-trait",
"log", "log",
@ -5637,7 +5633,7 @@ dependencies = [
[[package]] [[package]]
name = "logos-blockchain-ledger" name = "logos-blockchain-ledger"
version = "0.1.2" version = "0.1.2"
source = "git+https://github.com/logos-blockchain/logos-blockchain.git?rev=ee281a447d95a951752461ee0a6e88eb4a0f17cf#ee281a447d95a951752461ee0a6e88eb4a0f17cf" source = "git+https://github.com/logos-blockchain/logos-blockchain.git?rev=dd055cc1ef7c130f710a52a190edd97bc7b0f71b#dd055cc1ef7c130f710a52a190edd97bc7b0f71b"
dependencies = [ dependencies = [
"derivative", "derivative",
"logos-blockchain-blend-crypto", "logos-blockchain-blend-crypto",
@ -5656,14 +5652,14 @@ dependencies = [
"rpds", "rpds",
"serde", "serde",
"serde_arrays", "serde_arrays",
"thiserror 1.0.69", "thiserror 2.0.18",
"tracing", "tracing",
] ]
[[package]] [[package]]
name = "logos-blockchain-libp2p" name = "logos-blockchain-libp2p"
version = "0.1.2" version = "0.1.2"
source = "git+https://github.com/logos-blockchain/logos-blockchain.git?rev=ee281a447d95a951752461ee0a6e88eb4a0f17cf#ee281a447d95a951752461ee0a6e88eb4a0f17cf" source = "git+https://github.com/logos-blockchain/logos-blockchain.git?rev=dd055cc1ef7c130f710a52a190edd97bc7b0f71b#dd055cc1ef7c130f710a52a190edd97bc7b0f71b"
dependencies = [ dependencies = [
"async-trait", "async-trait",
"backon", "backon",
@ -5674,6 +5670,7 @@ dependencies = [
"igd-next 0.16.2", "igd-next 0.16.2",
"libp2p", "libp2p",
"logos-blockchain-cryptarchia-sync", "logos-blockchain-cryptarchia-sync",
"logos-blockchain-log-targets",
"logos-blockchain-utils", "logos-blockchain-utils",
"multiaddr", "multiaddr",
"natpmp", "natpmp",
@ -5682,16 +5679,34 @@ 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",
"zerocopy", "zerocopy",
] ]
[[package]]
name = "logos-blockchain-log-targets"
version = "0.1.2"
source = "git+https://github.com/logos-blockchain/logos-blockchain.git?rev=dd055cc1ef7c130f710a52a190edd97bc7b0f71b#dd055cc1ef7c130f710a52a190edd97bc7b0f71b"
dependencies = [
"logos-blockchain-log-targets-macros",
]
[[package]]
name = "logos-blockchain-log-targets-macros"
version = "0.1.2"
source = "git+https://github.com/logos-blockchain/logos-blockchain.git?rev=dd055cc1ef7c130f710a52a190edd97bc7b0f71b#dd055cc1ef7c130f710a52a190edd97bc7b0f71b"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.117",
]
[[package]] [[package]]
name = "logos-blockchain-mmr" name = "logos-blockchain-mmr"
version = "0.1.2" version = "0.1.2"
source = "git+https://github.com/logos-blockchain/logos-blockchain.git?rev=ee281a447d95a951752461ee0a6e88eb4a0f17cf#ee281a447d95a951752461ee0a6e88eb4a0f17cf" source = "git+https://github.com/logos-blockchain/logos-blockchain.git?rev=dd055cc1ef7c130f710a52a190edd97bc7b0f71b#dd055cc1ef7c130f710a52a190edd97bc7b0f71b"
dependencies = [ dependencies = [
"ark-ff 0.4.2", "ark-ff 0.4.2",
"logos-blockchain-groth16", "logos-blockchain-groth16",
@ -5704,13 +5719,14 @@ dependencies = [
[[package]] [[package]]
name = "logos-blockchain-network-service" name = "logos-blockchain-network-service"
version = "0.1.2" version = "0.1.2"
source = "git+https://github.com/logos-blockchain/logos-blockchain.git?rev=ee281a447d95a951752461ee0a6e88eb4a0f17cf#ee281a447d95a951752461ee0a6e88eb4a0f17cf" source = "git+https://github.com/logos-blockchain/logos-blockchain.git?rev=dd055cc1ef7c130f710a52a190edd97bc7b0f71b#dd055cc1ef7c130f710a52a190edd97bc7b0f71b"
dependencies = [ dependencies = [
"async-trait", "async-trait",
"futures", "futures",
"logos-blockchain-core", "logos-blockchain-core",
"logos-blockchain-cryptarchia-sync", "logos-blockchain-cryptarchia-sync",
"logos-blockchain-libp2p", "logos-blockchain-libp2p",
"logos-blockchain-log-targets",
"logos-blockchain-tracing", "logos-blockchain-tracing",
"overwatch", "overwatch",
"rand 0.8.5", "rand 0.8.5",
@ -5724,47 +5740,48 @@ dependencies = [
[[package]] [[package]]
name = "logos-blockchain-poc" name = "logos-blockchain-poc"
version = "0.1.2" version = "0.1.2"
source = "git+https://github.com/logos-blockchain/logos-blockchain.git?rev=ee281a447d95a951752461ee0a6e88eb4a0f17cf#ee281a447d95a951752461ee0a6e88eb4a0f17cf" source = "git+https://github.com/logos-blockchain/logos-blockchain.git?rev=dd055cc1ef7c130f710a52a190edd97bc7b0f71b#dd055cc1ef7c130f710a52a190edd97bc7b0f71b"
dependencies = [ 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 0.4.6", "num-bigint 0.4.6",
"serde", "serde",
"serde_json", "serde_json",
"thiserror 2.0.18",
"tracing", "tracing",
] ]
[[package]] [[package]]
name = "logos-blockchain-pol" name = "logos-blockchain-pol"
version = "0.1.2" version = "0.1.2"
source = "git+https://github.com/logos-blockchain/logos-blockchain.git?rev=ee281a447d95a951752461ee0a6e88eb4a0f17cf#ee281a447d95a951752461ee0a6e88eb4a0f17cf" source = "git+https://github.com/logos-blockchain/logos-blockchain.git?rev=dd055cc1ef7c130f710a52a190edd97bc7b0f71b#dd055cc1ef7c130f710a52a190edd97bc7b0f71b"
dependencies = [ dependencies = [
"astro-float", "astro-float",
"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 0.4.6", "num-bigint 0.4.6",
"num-traits", "num-traits",
"serde", "serde",
"serde_json", "serde_json",
"thiserror 2.0.18",
"tracing", "tracing",
] ]
[[package]] [[package]]
name = "logos-blockchain-poq" name = "logos-blockchain-poq"
version = "0.1.2" version = "0.1.2"
source = "git+https://github.com/logos-blockchain/logos-blockchain.git?rev=ee281a447d95a951752461ee0a6e88eb4a0f17cf#ee281a447d95a951752461ee0a6e88eb4a0f17cf" source = "git+https://github.com/logos-blockchain/logos-blockchain.git?rev=dd055cc1ef7c130f710a52a190edd97bc7b0f71b#dd055cc1ef7c130f710a52a190edd97bc7b0f71b"
dependencies = [ 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-pol", "logos-blockchain-pol",
"logos-blockchain-proofs-error",
"logos-blockchain-witness-generator", "logos-blockchain-witness-generator",
"num-bigint 0.4.6", "num-bigint 0.4.6",
"serde", "serde",
@ -5776,7 +5793,7 @@ dependencies = [
[[package]] [[package]]
name = "logos-blockchain-poseidon2" name = "logos-blockchain-poseidon2"
version = "0.1.2" version = "0.1.2"
source = "git+https://github.com/logos-blockchain/logos-blockchain.git?rev=ee281a447d95a951752461ee0a6e88eb4a0f17cf#ee281a447d95a951752461ee0a6e88eb4a0f17cf" source = "git+https://github.com/logos-blockchain/logos-blockchain.git?rev=dd055cc1ef7c130f710a52a190edd97bc7b0f71b#dd055cc1ef7c130f710a52a190edd97bc7b0f71b"
dependencies = [ dependencies = [
"ark-bn254 0.4.0", "ark-bn254 0.4.0",
"ark-ff 0.4.2", "ark-ff 0.4.2",
@ -5784,10 +5801,20 @@ dependencies = [
"num-bigint 0.4.6", "num-bigint 0.4.6",
] ]
[[package]]
name = "logos-blockchain-proofs-error"
version = "0.1.2"
source = "git+https://github.com/logos-blockchain/logos-blockchain.git?rev=dd055cc1ef7c130f710a52a190edd97bc7b0f71b#dd055cc1ef7c130f710a52a190edd97bc7b0f71b"
dependencies = [
"logos-blockchain-groth16",
"serde_json",
"thiserror 2.0.18",
]
[[package]] [[package]]
name = "logos-blockchain-services-utils" name = "logos-blockchain-services-utils"
version = "0.1.2" version = "0.1.2"
source = "git+https://github.com/logos-blockchain/logos-blockchain.git?rev=ee281a447d95a951752461ee0a6e88eb4a0f17cf#ee281a447d95a951752461ee0a6e88eb4a0f17cf" source = "git+https://github.com/logos-blockchain/logos-blockchain.git?rev=dd055cc1ef7c130f710a52a190edd97bc7b0f71b#dd055cc1ef7c130f710a52a190edd97bc7b0f71b"
dependencies = [ dependencies = [
"async-trait", "async-trait",
"futures", "futures",
@ -5795,24 +5822,25 @@ dependencies = [
"overwatch", "overwatch",
"serde", "serde",
"serde_json", "serde_json",
"thiserror 1.0.69", "thiserror 2.0.18",
"tracing", "tracing",
] ]
[[package]] [[package]]
name = "logos-blockchain-storage-service" name = "logos-blockchain-storage-service"
version = "0.1.2" version = "0.1.2"
source = "git+https://github.com/logos-blockchain/logos-blockchain.git?rev=ee281a447d95a951752461ee0a6e88eb4a0f17cf#ee281a447d95a951752461ee0a6e88eb4a0f17cf" source = "git+https://github.com/logos-blockchain/logos-blockchain.git?rev=dd055cc1ef7c130f710a52a190edd97bc7b0f71b#dd055cc1ef7c130f710a52a190edd97bc7b0f71b"
dependencies = [ dependencies = [
"async-trait", "async-trait",
"bytes", "bytes",
"futures", "futures",
"logos-blockchain-core", "logos-blockchain-core",
"logos-blockchain-cryptarchia-engine", "logos-blockchain-cryptarchia-engine",
"logos-blockchain-log-targets",
"logos-blockchain-tracing", "logos-blockchain-tracing",
"overwatch", "overwatch",
"serde", "serde",
"thiserror 1.0.69", "thiserror 2.0.18",
"tokio", "tokio",
"tracing", "tracing",
] ]
@ -5820,12 +5848,13 @@ dependencies = [
[[package]] [[package]]
name = "logos-blockchain-time-service" name = "logos-blockchain-time-service"
version = "0.1.2" version = "0.1.2"
source = "git+https://github.com/logos-blockchain/logos-blockchain.git?rev=ee281a447d95a951752461ee0a6e88eb4a0f17cf#ee281a447d95a951752461ee0a6e88eb4a0f17cf" source = "git+https://github.com/logos-blockchain/logos-blockchain.git?rev=dd055cc1ef7c130f710a52a190edd97bc7b0f71b#dd055cc1ef7c130f710a52a190edd97bc7b0f71b"
dependencies = [ dependencies = [
"async-trait", "async-trait",
"futures", "futures",
"log", "log",
"logos-blockchain-cryptarchia-engine", "logos-blockchain-cryptarchia-engine",
"logos-blockchain-log-targets",
"logos-blockchain-tracing", "logos-blockchain-tracing",
"logos-blockchain-utils", "logos-blockchain-utils",
"overwatch", "overwatch",
@ -5842,8 +5871,10 @@ dependencies = [
[[package]] [[package]]
name = "logos-blockchain-tracing" name = "logos-blockchain-tracing"
version = "0.1.2" version = "0.1.2"
source = "git+https://github.com/logos-blockchain/logos-blockchain.git?rev=ee281a447d95a951752461ee0a6e88eb4a0f17cf#ee281a447d95a951752461ee0a6e88eb4a0f17cf" source = "git+https://github.com/logos-blockchain/logos-blockchain.git?rev=dd055cc1ef7c130f710a52a190edd97bc7b0f71b#dd055cc1ef7c130f710a52a190edd97bc7b0f71b"
dependencies = [ dependencies = [
"flate2",
"logos-blockchain-log-targets",
"opentelemetry", "opentelemetry",
"opentelemetry-appender-tracing", "opentelemetry-appender-tracing",
"opentelemetry-http", "opentelemetry-http",
@ -5866,7 +5897,7 @@ dependencies = [
[[package]] [[package]]
name = "logos-blockchain-utils" name = "logos-blockchain-utils"
version = "0.1.2" version = "0.1.2"
source = "git+https://github.com/logos-blockchain/logos-blockchain.git?rev=ee281a447d95a951752461ee0a6e88eb4a0f17cf#ee281a447d95a951752461ee0a6e88eb4a0f17cf" source = "git+https://github.com/logos-blockchain/logos-blockchain.git?rev=dd055cc1ef7c130f710a52a190edd97bc7b0f71b#dd055cc1ef7c130f710a52a190edd97bc7b0f71b"
dependencies = [ dependencies = [
"async-trait", "async-trait",
"blake2", "blake2",
@ -5877,13 +5908,15 @@ dependencies = [
"rand 0.8.5", "rand 0.8.5",
"serde", "serde",
"serde_with", "serde_with",
"serde_yaml",
"thiserror 2.0.18",
"time", "time",
] ]
[[package]] [[package]]
name = "logos-blockchain-utxotree" name = "logos-blockchain-utxotree"
version = "0.1.2" version = "0.1.2"
source = "git+https://github.com/logos-blockchain/logos-blockchain.git?rev=ee281a447d95a951752461ee0a6e88eb4a0f17cf#ee281a447d95a951752461ee0a6e88eb4a0f17cf" source = "git+https://github.com/logos-blockchain/logos-blockchain.git?rev=dd055cc1ef7c130f710a52a190edd97bc7b0f71b#dd055cc1ef7c130f710a52a190edd97bc7b0f71b"
dependencies = [ dependencies = [
"ark-ff 0.4.2", "ark-ff 0.4.2",
"logos-blockchain-groth16", "logos-blockchain-groth16",
@ -5891,13 +5924,13 @@ dependencies = [
"num-bigint 0.4.6", "num-bigint 0.4.6",
"rpds", "rpds",
"serde", "serde",
"thiserror 1.0.69", "thiserror 2.0.18",
] ]
[[package]] [[package]]
name = "logos-blockchain-witness-generator" name = "logos-blockchain-witness-generator"
version = "0.1.2" version = "0.1.2"
source = "git+https://github.com/logos-blockchain/logos-blockchain.git?rev=ee281a447d95a951752461ee0a6e88eb4a0f17cf#ee281a447d95a951752461ee0a6e88eb4a0f17cf" source = "git+https://github.com/logos-blockchain/logos-blockchain.git?rev=dd055cc1ef7c130f710a52a190edd97bc7b0f71b#dd055cc1ef7c130f710a52a190edd97bc7b0f71b"
dependencies = [ dependencies = [
"tempfile", "tempfile",
] ]
@ -5905,12 +5938,13 @@ dependencies = [
[[package]] [[package]]
name = "logos-blockchain-zksign" name = "logos-blockchain-zksign"
version = "0.1.2" version = "0.1.2"
source = "git+https://github.com/logos-blockchain/logos-blockchain.git?rev=ee281a447d95a951752461ee0a6e88eb4a0f17cf#ee281a447d95a951752461ee0a6e88eb4a0f17cf" source = "git+https://github.com/logos-blockchain/logos-blockchain.git?rev=dd055cc1ef7c130f710a52a190edd97bc7b0f71b#dd055cc1ef7c130f710a52a190edd97bc7b0f71b"
dependencies = [ 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-poseidon2", "logos-blockchain-poseidon2",
"logos-blockchain-proofs-error",
"logos-blockchain-witness-generator", "logos-blockchain-witness-generator",
"num-bigint 0.4.6", "num-bigint 0.4.6",
"serde", "serde",
@ -5922,13 +5956,15 @@ dependencies = [
[[package]] [[package]]
name = "logos-blockchain-zone-sdk" name = "logos-blockchain-zone-sdk"
version = "0.1.2" version = "0.1.2"
source = "git+https://github.com/logos-blockchain/logos-blockchain.git?rev=ee281a447d95a951752461ee0a6e88eb4a0f17cf#ee281a447d95a951752461ee0a6e88eb4a0f17cf" source = "git+https://github.com/logos-blockchain/logos-blockchain.git?rev=dd055cc1ef7c130f710a52a190edd97bc7b0f71b#dd055cc1ef7c130f710a52a190edd97bc7b0f71b"
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-groth16",
"logos-blockchain-http-api-common",
"logos-blockchain-key-management-system-service", "logos-blockchain-key-management-system-service",
"rand 0.8.5", "rand 0.8.5",
"reqwest", "reqwest",
@ -7258,6 +7294,30 @@ dependencies = [
"toml_edit 0.25.4+spec-1.1.0", "toml_edit 0.25.4+spec-1.1.0",
] ]
[[package]]
name = "proc-macro-error"
version = "1.0.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c"
dependencies = [
"proc-macro-error-attr",
"proc-macro2",
"quote",
"syn 1.0.109",
"version_check",
]
[[package]]
name = "proc-macro-error-attr"
version = "1.0.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869"
dependencies = [
"proc-macro2",
"quote",
"version_check",
]
[[package]] [[package]]
name = "proc-macro-error-attr2" name = "proc-macro-error-attr2"
version = "2.0.0" version = "2.0.0"
@ -7606,7 +7666,7 @@ dependencies = [
"once_cell", "once_cell",
"socket2 0.6.3", "socket2 0.6.3",
"tracing", "tracing",
"windows-sys 0.59.0", "windows-sys 0.52.0",
] ]
[[package]] [[package]]
@ -8525,7 +8585,7 @@ dependencies = [
"errno", "errno",
"libc", "libc",
"linux-raw-sys", "linux-raw-sys",
"windows-sys 0.61.2", "windows-sys 0.52.0",
] ]
[[package]] [[package]]
@ -8583,7 +8643,7 @@ dependencies = [
"security-framework", "security-framework",
"security-framework-sys", "security-framework-sys",
"webpki-root-certs 0.26.11", "webpki-root-certs 0.26.11",
"windows-sys 0.59.0", "windows-sys 0.52.0",
] ]
[[package]] [[package]]
@ -8793,11 +8853,13 @@ version = "0.1.0"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"borsh", "borsh",
"bridge_core",
"bytesize", "bytesize",
"chrono", "chrono",
"common", "common",
"faucet_core", "faucet_core",
"futures", "futures",
"hex",
"humantime-serde", "humantime-serde",
"log", "log",
"logos-blockchain-core", "logos-blockchain-core",
@ -8824,7 +8886,6 @@ version = "0.1.0"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"borsh", "borsh",
"bridge_core",
"bytesize", "bytesize",
"clap", "clap",
"common", "common",
@ -8832,8 +8893,6 @@ dependencies = [
"futures", "futures",
"jsonrpsee", "jsonrpsee",
"log", "log",
"logos-blockchain-core",
"logos-blockchain-zone-sdk",
"mempool", "mempool",
"nssa", "nssa",
"sequencer_core", "sequencer_core",
@ -8841,7 +8900,6 @@ dependencies = [
"sequencer_service_rpc", "sequencer_service_rpc",
"tokio", "tokio",
"tokio-util", "tokio-util",
"vault_core",
] ]
[[package]] [[package]]
@ -9360,6 +9418,12 @@ 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 = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292"
[[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"
@ -9506,7 +9570,7 @@ dependencies = [
"getrandom 0.4.2", "getrandom 0.4.2",
"once_cell", "once_cell",
"rustix", "rustix",
"windows-sys 0.61.2", "windows-sys 0.52.0",
] ]
[[package]] [[package]]
@ -10083,11 +10147,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",
@ -10501,6 +10566,30 @@ version = "0.2.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821"
[[package]]
name = "utoipa"
version = "4.2.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c5afb1a60e207dca502682537fefcfd9921e71d0b83e9576060f09abc6efab23"
dependencies = [
"indexmap 2.13.0",
"serde",
"serde_json",
"utoipa-gen",
]
[[package]]
name = "utoipa-gen"
version = "4.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "20c24e8ab68ff9ee746aad22d39b5535601e6416d1b0feeabf78be986a5c4392"
dependencies = [
"proc-macro-error",
"proc-macro2",
"quote",
"syn 2.0.117",
]
[[package]] [[package]]
name = "uuid" name = "uuid"
version = "1.22.0" version = "1.22.0"
@ -10512,6 +10601,36 @@ dependencies = [
"wasm-bindgen", "wasm-bindgen",
] ]
[[package]]
name = "validator"
version = "0.20.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "43fb22e1a008ece370ce08a3e9e4447a910e92621bb49b85d6e48a45397e7cfa"
dependencies = [
"idna",
"once_cell",
"regex",
"serde",
"serde_derive",
"serde_json",
"url",
"validator_derive",
]
[[package]]
name = "validator_derive"
version = "0.20.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b7df16e474ef958526d1205f6dda359fdfab79d9aa6d54bafcb92dcd07673dca"
dependencies = [
"darling 0.20.11",
"once_cell",
"proc-macro-error2",
"proc-macro2",
"quote",
"syn 2.0.117",
]
[[package]] [[package]]
name = "valuable" name = "valuable"
version = "0.1.1" version = "0.1.1"
@ -10867,7 +10986,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

@ -137,13 +137,13 @@ schemars = "1.2"
async-stream = "0.3.6" async-stream = "0.3.6"
criterion = { version = "0.8", features = ["html_reports"] } criterion = { version = "0.8", features = ["html_reports"] }
logos-blockchain-common-http-client = { git = "https://github.com/logos-blockchain/logos-blockchain.git", rev = "ee281a447d95a951752461ee0a6e88eb4a0f17cf" } logos-blockchain-common-http-client = { git = "https://github.com/logos-blockchain/logos-blockchain.git", rev = "dd055cc1ef7c130f710a52a190edd97bc7b0f71b" }
logos-blockchain-key-management-system-service = { git = "https://github.com/logos-blockchain/logos-blockchain.git", rev = "ee281a447d95a951752461ee0a6e88eb4a0f17cf" } logos-blockchain-key-management-system-service = { git = "https://github.com/logos-blockchain/logos-blockchain.git", rev = "dd055cc1ef7c130f710a52a190edd97bc7b0f71b" }
logos-blockchain-core = { git = "https://github.com/logos-blockchain/logos-blockchain.git", rev = "ee281a447d95a951752461ee0a6e88eb4a0f17cf" } logos-blockchain-core = { git = "https://github.com/logos-blockchain/logos-blockchain.git", rev = "dd055cc1ef7c130f710a52a190edd97bc7b0f71b" }
logos-blockchain-chain-broadcast-service = { git = "https://github.com/logos-blockchain/logos-blockchain.git", rev = "ee281a447d95a951752461ee0a6e88eb4a0f17cf" } logos-blockchain-chain-broadcast-service = { git = "https://github.com/logos-blockchain/logos-blockchain.git", rev = "dd055cc1ef7c130f710a52a190edd97bc7b0f71b" }
logos-blockchain-chain-service = { git = "https://github.com/logos-blockchain/logos-blockchain.git", rev = "ee281a447d95a951752461ee0a6e88eb4a0f17cf" } logos-blockchain-chain-service = { git = "https://github.com/logos-blockchain/logos-blockchain.git", rev = "dd055cc1ef7c130f710a52a190edd97bc7b0f71b" }
logos-blockchain-zone-sdk = { git = "https://github.com/logos-blockchain/logos-blockchain.git", rev = "ee281a447d95a951752461ee0a6e88eb4a0f17cf" } logos-blockchain-zone-sdk = { git = "https://github.com/logos-blockchain/logos-blockchain.git", rev = "dd055cc1ef7c130f710a52a190edd97bc7b0f71b" }
logos-blockchain-http-api-common = { git = "https://github.com/logos-blockchain/logos-blockchain.git", rev = "ee281a447d95a951752461ee0a6e88eb4a0f17cf" } logos-blockchain-http-api-common = { git = "https://github.com/logos-blockchain/logos-blockchain.git", rev = "dd055cc1ef7c130f710a52a190edd97bc7b0f71b" }
rocksdb = { version = "0.24.0", default-features = false, features = [ rocksdb = { version = "0.24.0", default-features = false, features = [
"snappy", "snappy",

View File

@ -67,7 +67,9 @@ cryptarchia:
- opcode: 17 - opcode: 17
payload: payload:
channel_id: '0000000000000000000000000000000000000000000000000000000000000000' channel_id: '0000000000000000000000000000000000000000000000000000000000000000'
inscription: '67656e65736973' # chain_id_len=12 (u64_le), chain_id=logos-devnet (utf-8),
# genesis_time=2026-01-10T07:47:56Z (u64_le), epoch_nonce=[0u8; 32]
inscription: '0c000000000000006c6f676f732d6465766e65742c046269000000000000000000000000000000000000000000000000000000000000000000000000'
parent: '0000000000000000000000000000000000000000000000000000000000000000' parent: '0000000000000000000000000000000000000000000000000000000000000000'
signer: '0000000000000000000000000000000000000000000000000000000000000000' signer: '0000000000000000000000000000000000000000000000000000000000000000'
execution_gas_price: 0 execution_gas_price: 0

View File

@ -1,7 +1,7 @@
services: services:
logos-blockchain-node-0: logos-blockchain-node-0:
image: ghcr.io/logos-blockchain/logos-blockchain@sha256:9f1829dea335c56f6ff68ae37ea872ed5313b96b69e8ffe143c02b7217de85fc image: ghcr.io/logos-blockchain/logos-blockchain@sha256:f160cfbf898a06554451cc066d84cfd0f8ab62d59bd3e62d9cde3bd5582c12ab
ports: ports:
- "${PORT:-8080}:18080/tcp" - "${PORT:-8080}:18080/tcp"
volumes: volumes:

View File

@ -6,7 +6,7 @@ use common::{
transaction::{NSSATransaction, clock_invocation}, transaction::{NSSATransaction, clock_invocation},
}; };
use log::info; use log::info;
use logos_blockchain_core::{header::HeaderId, mantle::ops::channel::MsgId}; use logos_blockchain_core::header::HeaderId;
use logos_blockchain_zone_sdk::Slot; use logos_blockchain_zone_sdk::Slot;
use nssa::{Account, AccountId, V03State}; use nssa::{Account, AccountId, V03State};
use nssa_core::BlockId; use nssa_core::BlockId;
@ -97,16 +97,16 @@ impl IndexerStore {
Ok(self.dbio.calculate_state_for_id(block_id)?) Ok(self.dbio.calculate_state_for_id(block_id)?)
} }
pub fn get_zone_cursor(&self) -> Result<Option<(MsgId, Slot)>> { pub fn get_zone_cursor(&self) -> Result<Option<Slot>> {
let Some(bytes) = self.dbio.get_zone_sdk_indexer_cursor_bytes()? else { let Some(bytes) = self.dbio.get_zone_sdk_indexer_cursor_bytes()? else {
return Ok(None); return Ok(None);
}; };
let cursor: (MsgId, Slot) = serde_json::from_slice(&bytes) let cursor: Slot = serde_json::from_slice(&bytes)
.context("Failed to deserialize stored zone-sdk indexer cursor")?; .context("Failed to deserialize stored zone-sdk indexer cursor")?;
Ok(Some(cursor)) Ok(Some(cursor))
} }
pub fn set_zone_cursor(&self, cursor: &(MsgId, Slot)) -> Result<()> { pub fn set_zone_cursor(&self, cursor: &Slot) -> Result<()> {
let bytes = let bytes =
serde_json::to_vec(cursor).context("Failed to serialize zone-sdk indexer cursor")?; serde_json::to_vec(cursor).context("Failed to serialize zone-sdk indexer cursor")?;
self.dbio.put_zone_sdk_indexer_cursor_bytes(&bytes)?; self.dbio.put_zone_sdk_indexer_cursor_bytes(&bytes)?;

View File

@ -81,8 +81,8 @@ impl IndexerCore {
error!("Failed to deserialize L2 block from zone-sdk: {e}"); error!("Failed to deserialize L2 block from zone-sdk: {e}");
// Advance past the broken inscription so we don't // Advance past the broken inscription so we don't
// re-process it on restart. // re-process it on restart.
cursor = Some((zone_block.id, slot)); cursor = Some(slot);
if let Err(err) = self.store.set_zone_cursor(&(zone_block.id, slot)) { if let Err(err) = self.store.set_zone_cursor(&slot) {
warn!("Failed to persist indexer cursor: {err:#}"); warn!("Failed to persist indexer cursor: {err:#}");
} }
continue; continue;
@ -98,8 +98,8 @@ impl IndexerCore {
error!("Failed to store block {}: {err:#}", block.header.block_id); error!("Failed to store block {}: {err:#}", block.header.block_id);
} }
cursor = Some((zone_block.id, slot)); cursor = Some(slot);
if let Err(err) = self.store.set_zone_cursor(&(zone_block.id, slot)) { if let Err(err) = self.store.set_zone_cursor(&slot) {
warn!("Failed to persist indexer cursor: {err:#}"); warn!("Failed to persist indexer cursor: {err:#}");
} }
yield Ok(block); yield Ok(block);

View File

@ -27,7 +27,7 @@ use nssa_core::{InputAccountIdentity, account::AccountWithMetadata};
use sequencer_service_rpc::RpcClient as _; use sequencer_service_rpc::RpcClient as _;
use tokio::test; use tokio::test;
const TIME_TO_FINALIZE_DEPOSIT_EVENT_ON_BEDROCK: Duration = Duration::from_mins(6); const TIME_TO_FINALIZE_DEPOSIT_EVENT_ON_BEDROCK: Duration = Duration::from_mins(2);
#[test] #[test]
async fn public_bridge_deposit_invocation_is_dropped() -> anyhow::Result<()> { async fn public_bridge_deposit_invocation_is_dropped() -> anyhow::Result<()> {

View File

@ -16,6 +16,7 @@ mempool.workspace = true
logos-blockchain-zone-sdk.workspace = true logos-blockchain-zone-sdk.workspace = true
testnet_initial_state.workspace = true testnet_initial_state.workspace = true
faucet_core.workspace = true faucet_core.workspace = true
bridge_core.workspace = true
vault_core.workspace = true vault_core.workspace = true
anyhow.workspace = true anyhow.workspace = true
@ -31,6 +32,7 @@ logos-blockchain-core.workspace = true
rand.workspace = true rand.workspace = true
borsh.workspace = true borsh.workspace = true
bytesize.workspace = true bytesize.workspace = true
hex.workspace = true
url.workspace = true url.workspace = true
[features] [features]

View File

@ -1,6 +1,6 @@
use std::{sync::Arc, time::Duration}; use std::{pin::Pin, sync::Arc, time::Duration};
use anyhow::{Context as _, Result, anyhow}; use anyhow::{Context as _, Result};
use common::block::Block; use common::block::Block;
use log::warn; use log::warn;
pub use logos_blockchain_core::mantle::ops::channel::MsgId; pub use logos_blockchain_core::mantle::ops::channel::MsgId;
@ -10,7 +10,7 @@ use logos_blockchain_zone_sdk::{
CommonHttpClient, CommonHttpClient,
adapter::NodeHttpClient, adapter::NodeHttpClient,
sequencer::{Event, SequencerConfig as ZoneSdkSequencerConfig, SequencerHandle, ZoneSequencer}, sequencer::{Event, SequencerConfig as ZoneSdkSequencerConfig, SequencerHandle, ZoneSequencer},
state::InscriptionInfo, state::{DepositInfo, FinalizedOp, InscriptionInfo},
}; };
use tokio::task::JoinHandle; use tokio::task::JoinHandle;
@ -18,12 +18,16 @@ use crate::config::BedrockConfig;
/// Sink for `Event::Published` checkpoints emitted by the drive task. /// Sink for `Event::Published` checkpoints emitted by the drive task.
/// Caller is responsible for persistence (e.g. writing to rocksdb). /// Caller is responsible for persistence (e.g. writing to rocksdb).
pub type CheckpointSink = Box<dyn Fn(SequencerCheckpoint) + Send + Sync + 'static>; pub type CheckpointSink = Box<dyn Fn(SequencerCheckpoint) + Send + 'static>;
/// Sink for finalized L2 block ids derived from `Event::TxsFinalized` and /// Sink for finalized L2 block ids derived from `Event::TxsFinalized` and
/// `Event::FinalizedInscriptions`. Caller is responsible for cleanup /// `Event::FinalizedInscriptions`. Caller is responsible for cleanup
/// (e.g. marking pending blocks as finalized in storage). /// (e.g. marking pending blocks as finalized in storage).
pub type FinalizedBlockSink = Box<dyn Fn(u64) + Send + Sync + 'static>; pub type FinalizedBlockSink = Box<dyn Fn(u64) + Send + 'static>;
/// Sink for finalized Bedrock deposit events.
pub type OnDepositEventSink =
Box<dyn Fn(DepositInfo) -> Pin<Box<dyn Future<Output = ()> + Send>> + Send + 'static>;
#[expect(async_fn_in_trait, reason = "We don't care about Send/Sync here")] #[expect(async_fn_in_trait, reason = "We don't care about Send/Sync here")]
pub trait BlockPublisherTrait: Clone { pub trait BlockPublisherTrait: Clone {
@ -34,6 +38,7 @@ pub trait BlockPublisherTrait: Clone {
initial_checkpoint: Option<SequencerCheckpoint>, initial_checkpoint: Option<SequencerCheckpoint>,
on_checkpoint: CheckpointSink, on_checkpoint: CheckpointSink,
on_finalized_block: FinalizedBlockSink, on_finalized_block: FinalizedBlockSink,
on_deposit_event: OnDepositEventSink,
) -> Result<Self>; ) -> Result<Self>;
/// Fire-and-forget publish. Zone-sdk drives the actual submission and /// Fire-and-forget publish. Zone-sdk drives the actual submission and
@ -65,6 +70,7 @@ impl BlockPublisherTrait for ZoneSdkPublisher {
initial_checkpoint: Option<SequencerCheckpoint>, initial_checkpoint: Option<SequencerCheckpoint>,
on_checkpoint: CheckpointSink, on_checkpoint: CheckpointSink,
on_finalized_block: FinalizedBlockSink, on_finalized_block: FinalizedBlockSink,
on_deposit_event: OnDepositEventSink,
) -> Result<Self> { ) -> Result<Self> {
let basic_auth = config.auth.clone().map(Into::into); let basic_auth = config.auth.clone().map(Into::into);
let node = NodeHttpClient::new(CommonHttpClient::new(basic_auth), config.node_url.clone()); let node = NodeHttpClient::new(CommonHttpClient::new(basic_auth), config.node_url.clone());
@ -89,10 +95,20 @@ impl BlockPublisherTrait for ZoneSdkPublisher {
}; };
match event { match event {
Event::Published { checkpoint, .. } => on_checkpoint(checkpoint), Event::Published { checkpoint, .. } => on_checkpoint(checkpoint),
Event::TxsFinalized { inscriptions, .. } Event::TxsFinalized { items } => {
| Event::FinalizedInscriptions { inscriptions } => { for op in items.into_iter().flat_map(|item| item.ops) {
if let Some(max_block_id) = max_block_id_from_inscriptions(&inscriptions) { match op {
on_finalized_block(max_block_id); FinalizedOp::Inscription(inscription) => {
if let Some(block_id) = block_id_from_inscription(&inscription)
{
on_finalized_block(block_id);
}
}
FinalizedOp::Deposit(deposit) => {
on_deposit_event(deposit).await;
}
FinalizedOp::Withdraw(_) => {}
}
} }
} }
Event::ChannelUpdate { .. } | Event::Ready => {} Event::ChannelUpdate { .. } | Event::Ready => {}
@ -110,27 +126,26 @@ impl BlockPublisherTrait for ZoneSdkPublisher {
async fn publish_block(&self, block: &Block) -> Result<()> { async fn publish_block(&self, block: &Block) -> Result<()> {
let data = borsh::to_vec(block).context("Failed to serialize block")?; let data = borsh::to_vec(block).context("Failed to serialize block")?;
let data_bounded = data
.try_into()
.context("Block data exceeds maximum allowed size")?;
self.handle self.handle
.publish_message(data) .publish_message(data_bounded)
.await .await
.map_err(|e| anyhow!("zone-sdk publish failed: {e}"))?; .context("Failed to publish block")?;
Ok(()) Ok(())
} }
} }
/// Deserialize each inscription payload as a `Block` and return the highest /// Deserialize inscription payload as a `Block` and return it's`block_id`.
/// `block_id`. Bad payloads are logged and skipped. /// Bad payloads are logged and skipped.
fn max_block_id_from_inscriptions(inscriptions: &[InscriptionInfo]) -> Option<u64> { fn block_id_from_inscription(inscription: &InscriptionInfo) -> Option<u64> {
inscriptions borsh::from_slice::<Block>(&inscription.payload)
.iter() .inspect_err(|err| {
.filter_map( warn!("Failed to deserialize block from inscription: {err:?}");
|inscription| match borsh::from_slice::<Block>(&inscription.payload) { })
Ok(block) => Some(block.header.block_id), .ok()
Err(err) => { .map(|block| block.header.block_id)
warn!("Failed to deserialize finalized inscription as Block: {err:#}");
None
}
},
)
.max()
} }

View File

@ -1,6 +1,7 @@
use std::{path::Path, time::Instant}; use std::{path::Path, time::Instant};
use anyhow::{Context as _, Result, anyhow}; use anyhow::{Context as _, Result, anyhow};
use borsh::BorshDeserialize;
use common::{ use common::{
HashType, HashType,
block::{BedrockStatus, Block, HashableBlockData}, block::{BedrockStatus, Block, HashableBlockData},
@ -36,6 +37,17 @@ pub enum TransactionOrigin {
Sequencer, Sequencer,
} }
#[derive(Clone, Debug, BorshDeserialize)]
struct DepositMetadata {
recipient_id: nssa::AccountId,
}
impl DepositMetadata {
fn decode(bytes: &[u8]) -> Result<Self, std::io::Error> {
Self::try_from_slice(bytes)
}
}
pub struct SequencerCore<BP: BlockPublisherTrait = ZoneSdkPublisher> { pub struct SequencerCore<BP: BlockPublisherTrait = ZoneSdkPublisher> {
state: nssa::V03State, state: nssa::V03State,
store: SequencerStore, store: SequencerStore,
@ -140,6 +152,37 @@ impl<BP: BlockPublisherTrait> SequencerCore<BP> {
} }
}); });
let (mempool, mempool_handle) = MemPool::new(config.mempool_max_size);
let mempool_handle_for_deposit = mempool_handle.clone();
let on_deposit_event: block_publisher::OnDepositEventSink = Box::new(move |deposit| {
let mempool_handle_for_deposit = mempool_handle_for_deposit.clone();
Box::pin(async move {
info!(
"Observed Bedrock Deposit event with id: {:?}",
hex::encode(deposit.op_id)
);
let tx = match build_bridge_deposit_tx(&deposit) {
Ok(tx) => tx,
Err(err) => {
warn!(
"Skipping finalized Bedrock deposit event due to tx build failure: {err:#}"
);
return;
}
};
if let Err(err) = mempool_handle_for_deposit
.push((TransactionOrigin::Sequencer, tx))
.await
{
error!(
"Failed to queue sequencer transaction built from finalized Bedrock event: {err:#}"
);
}
})
});
let block_publisher = BP::new( let block_publisher = BP::new(
&config.bedrock_config, &config.bedrock_config,
bedrock_signing_key, bedrock_signing_key,
@ -147,6 +190,7 @@ impl<BP: BlockPublisherTrait> SequencerCore<BP> {
initial_checkpoint, initial_checkpoint,
on_checkpoint, on_checkpoint,
on_finalized_block, on_finalized_block,
on_deposit_event,
) )
.await .await
.expect("Failed to initialize Block Publisher"); .expect("Failed to initialize Block Publisher");
@ -159,8 +203,6 @@ impl<BP: BlockPublisherTrait> SequencerCore<BP> {
error!("Failed to publish genesis block: {err:#}"); error!("Failed to publish genesis block: {err:#}");
} }
let (mempool, mempool_handle) = MemPool::new(config.mempool_max_size);
let sequencer_core = Self { let sequencer_core = Self {
state, state,
store, store,
@ -443,6 +485,36 @@ fn build_supply_bridge_account_genesis_transaction(balance: u128) -> PublicTrans
PublicTransaction::new(message, witness_set) PublicTransaction::new(message, witness_set)
} }
fn build_bridge_deposit_tx(
deposit: &logos_blockchain_zone_sdk::state::DepositInfo,
) -> Result<NSSATransaction> {
let metadata = DepositMetadata::decode(&deposit.metadata)
.context("Failed to decode finalized Bedrock deposit metadata")?;
let bridge_program_id = Program::bridge().id();
let vault_program_id = Program::vault().id();
let recipient_vault_id =
vault_core::compute_vault_account_id(vault_program_id, metadata.recipient_id);
let message = Message::try_new(
bridge_program_id,
vec![nssa::system_bridge_account_id(), recipient_vault_id],
vec![],
bridge_core::Instruction::Deposit {
vault_program_id,
recipient_id: metadata.recipient_id,
amount: u128::from(deposit.amount),
},
)
.context("Failed to build bridge deposit message")?;
let witness_set = nssa::public_transaction::WitnessSet::from_raw_parts(vec![]);
Ok(NSSATransaction::Public(PublicTransaction::new(
message,
witness_set,
)))
}
/// Load signing key from file or generate a new one if it doesn't exist. /// Load signing key from file or generate a new one if it doesn't exist.
fn load_or_create_signing_key(path: &Path) -> Result<Ed25519Key> { fn load_or_create_signing_key(path: &Path) -> Result<Ed25519Key> {
if path.exists() { if path.exists() {

View File

@ -6,7 +6,8 @@ use logos_blockchain_key_management_system_service::keys::Ed25519Key;
use crate::{ use crate::{
block_publisher::{ block_publisher::{
BlockPublisherTrait, CheckpointSink, FinalizedBlockSink, SequencerCheckpoint, BlockPublisherTrait, CheckpointSink, FinalizedBlockSink, OnDepositEventSink,
SequencerCheckpoint,
}, },
config::BedrockConfig, config::BedrockConfig,
}; };
@ -24,6 +25,7 @@ impl BlockPublisherTrait for MockBlockPublisher {
_initial_checkpoint: Option<SequencerCheckpoint>, _initial_checkpoint: Option<SequencerCheckpoint>,
_on_checkpoint: CheckpointSink, _on_checkpoint: CheckpointSink,
_on_finalized_block: FinalizedBlockSink, _on_finalized_block: FinalizedBlockSink,
_on_deposit_event: OnDepositEventSink,
) -> Result<Self> { ) -> Result<Self> {
Ok(Self) Ok(Self)
} }

View File

@ -11,13 +11,9 @@ workspace = true
common.workspace = true common.workspace = true
nssa.workspace = true nssa.workspace = true
mempool.workspace = true mempool.workspace = true
bridge_core.workspace = true
vault_core.workspace = true
sequencer_core = { workspace = true, features = ["testnet"] } sequencer_core = { workspace = true, features = ["testnet"] }
sequencer_service_protocol.workspace = true sequencer_service_protocol.workspace = true
sequencer_service_rpc = { workspace = true, features = ["server"] } sequencer_service_rpc = { workspace = true, features = ["server"] }
logos-blockchain-zone-sdk.workspace = true
logos-blockchain-core.workspace = true
clap = { workspace = true, features = ["derive", "env"] } clap = { workspace = true, features = ["derive", "env"] }
anyhow.workspace = true anyhow.workspace = true

View File

@ -1,23 +1,11 @@
use std::{net::SocketAddr, sync::Arc, time::Duration}; use std::{net::SocketAddr, sync::Arc, time::Duration};
use anyhow::{Context as _, Result, anyhow}; use anyhow::{Context as _, Result, anyhow};
#[cfg(not(feature = "standalone"))]
use borsh::BorshDeserialize;
use bytesize::ByteSize; use bytesize::ByteSize;
use common::transaction::NSSATransaction; use common::transaction::NSSATransaction;
#[cfg(not(feature = "standalone"))]
use futures::StreamExt as _;
use futures::never::Never; use futures::never::Never;
use jsonrpsee::server::ServerHandle; use jsonrpsee::server::ServerHandle;
#[cfg(not(feature = "standalone"))]
use log::warn;
use log::{error, info}; use log::{error, info};
#[cfg(not(feature = "standalone"))]
use logos_blockchain_core::mantle::ops::channel::MsgId;
#[cfg(not(feature = "standalone"))]
use logos_blockchain_zone_sdk::{
CommonHttpClient, Slot, ZoneMessage, adapter::NodeHttpClient, indexer::ZoneIndexer,
};
use mempool::MemPoolHandle; use mempool::MemPoolHandle;
#[cfg(not(feature = "standalone"))] #[cfg(not(feature = "standalone"))]
use sequencer_core::SequencerCore; use sequencer_core::SequencerCore;
@ -32,19 +20,6 @@ pub mod service;
const REQUEST_BODY_MAX_SIZE: ByteSize = ByteSize::mib(10); const REQUEST_BODY_MAX_SIZE: ByteSize = ByteSize::mib(10);
#[cfg(not(feature = "standalone"))]
#[derive(Clone, Debug, BorshDeserialize)]
struct DepositMetadata {
recipient_id: nssa::AccountId,
}
#[cfg(not(feature = "standalone"))]
impl DepositMetadata {
fn decode(bytes: &[u8]) -> Result<Self, std::io::Error> {
Self::try_from_slice(bytes)
}
}
/// Handle to manage the sequencer and its tasks. /// Handle to manage the sequencer and its tasks.
/// ///
/// Implements `Drop` to ensure all tasks are aborted and the RPC server is stopped when dropped. /// Implements `Drop` to ensure all tasks are aborted and the RPC server is stopped when dropped.
@ -53,7 +28,6 @@ pub struct SequencerHandle {
/// Option because of `Drop` which forbids to simply move out of `self` in `stopped()`. /// Option because of `Drop` which forbids to simply move out of `self` in `stopped()`.
server_handle: Option<ServerHandle>, server_handle: Option<ServerHandle>,
main_loop_handle: JoinHandle<Result<Never>>, main_loop_handle: JoinHandle<Result<Never>>,
bedrock_deposit_loop_handle: Option<JoinHandle<Result<Never>>>,
} }
impl SequencerHandle { impl SequencerHandle {
@ -61,13 +35,11 @@ impl SequencerHandle {
addr: SocketAddr, addr: SocketAddr,
server_handle: ServerHandle, server_handle: ServerHandle,
main_loop_handle: JoinHandle<Result<Never>>, main_loop_handle: JoinHandle<Result<Never>>,
bedrock_deposit_loop_handle: Option<JoinHandle<Result<Never>>>,
) -> Self { ) -> Self {
Self { Self {
addr, addr,
server_handle: Some(server_handle), server_handle: Some(server_handle),
main_loop_handle, main_loop_handle,
bedrock_deposit_loop_handle,
} }
} }
@ -81,12 +53,9 @@ impl SequencerHandle {
addr: _, addr: _,
server_handle, server_handle,
main_loop_handle, main_loop_handle,
bedrock_deposit_loop_handle,
} = &mut self; } = &mut self;
let server_handle = server_handle.take().expect("Server handle is set"); let server_handle = server_handle.take().expect("Server handle is set");
let deposit_opt_fut =
futures::future::OptionFuture::from(bedrock_deposit_loop_handle.take());
tokio::select! { tokio::select! {
() = server_handle.stopped() => { () = server_handle.stopped() => {
Err(anyhow!("RPC Server stopped")) Err(anyhow!("RPC Server stopped"))
@ -96,11 +65,6 @@ impl SequencerHandle {
.context("Main loop task panicked")? .context("Main loop task panicked")?
.context("Main loop exited unexpectedly") .context("Main loop exited unexpectedly")
} }
Some(res) = deposit_opt_fut => {
res
.context("Bedrock deposit loop task panicked")?
.context("Bedrock deposit loop exited unexpectedly")
}
} }
} }
@ -114,14 +78,10 @@ impl SequencerHandle {
addr: _, addr: _,
server_handle, server_handle,
main_loop_handle, main_loop_handle,
bedrock_deposit_loop_handle,
} = self; } = self;
let stopped = server_handle.as_ref().is_none_or(ServerHandle::is_stopped) let stopped = server_handle.as_ref().is_none_or(ServerHandle::is_stopped)
|| main_loop_handle.is_finished() || main_loop_handle.is_finished();
|| bedrock_deposit_loop_handle
.as_ref()
.is_some_and(JoinHandle::is_finished);
!stopped !stopped
} }
@ -137,13 +97,9 @@ impl Drop for SequencerHandle {
addr: _, addr: _,
server_handle, server_handle,
main_loop_handle, main_loop_handle,
bedrock_deposit_loop_handle,
} = self; } = self;
main_loop_handle.abort(); main_loop_handle.abort();
if let Some(handle) = bedrock_deposit_loop_handle {
handle.abort();
}
let Some(handle) = server_handle else { let Some(handle) = server_handle else {
return; return;
@ -158,8 +114,6 @@ impl Drop for SequencerHandle {
pub async fn run(config: SequencerConfig, port: u16) -> Result<SequencerHandle> { pub async fn run(config: SequencerConfig, port: u16) -> Result<SequencerHandle> {
let block_timeout = config.block_create_timeout; let block_timeout = config.block_create_timeout;
let max_block_size = config.max_block_size; let max_block_size = config.max_block_size;
#[cfg(not(feature = "standalone"))]
let bedrock_config = config.bedrock_config.clone();
let (sequencer_core, mempool_handle) = SequencerCore::start_from_config(config).await; let (sequencer_core, mempool_handle) = SequencerCore::start_from_config(config).await;
@ -180,26 +134,9 @@ pub async fn run(config: SequencerConfig, port: u16) -> Result<SequencerHandle>
info!("Starting main sequencer loop"); info!("Starting main sequencer loop");
let main_loop_handle = tokio::spawn(main_loop(seq_core_wrapped, block_timeout)); let main_loop_handle = tokio::spawn(main_loop(seq_core_wrapped, block_timeout));
#[cfg(not(feature = "standalone"))] let _ = mempool_handle;
let bedrock_deposit_loop_handle = {
info!("Starting Bedrock deposit listener loop");
Some(tokio::spawn(bedrock_deposit_loop(
bedrock_config,
mempool_handle,
)))
};
#[cfg(feature = "standalone")]
let bedrock_deposit_loop_handle = {
let _ = mempool_handle;
None
};
Ok(SequencerHandle::new( Ok(SequencerHandle::new(addr, server_handle, main_loop_handle))
addr,
server_handle,
main_loop_handle,
bedrock_deposit_loop_handle,
))
} }
async fn run_server( async fn run_server(
@ -248,100 +185,3 @@ async fn main_loop(seq_core: Arc<Mutex<SequencerCore>>, block_timeout: Duration)
info!("Waiting for new transactions"); info!("Waiting for new transactions");
} }
} }
#[cfg(not(feature = "standalone"))]
async fn bedrock_deposit_loop(
bedrock_config: BedrockConfig,
mempool_handle: MemPoolHandle<(TransactionOrigin, NSSATransaction)>,
) -> Result<Never> {
let basic_auth = bedrock_config.auth.map(Into::into);
let node = NodeHttpClient::new(CommonHttpClient::new(basic_auth), bedrock_config.node_url);
let zone_indexer = ZoneIndexer::new(bedrock_config.channel_id, node);
let mut cursor: Option<(MsgId, Slot)> = None;
let poll_interval = Duration::from_secs(1);
// Short-term fix: dummy MsgId so zone-sdk skips the whole slot on re-poll.
// TODO: drop once zone-sdk indexer API is updated to take only `Slot`.
let dummy_msg_id = MsgId::from([0xff_u8; 32]);
loop {
let stream = match zone_indexer.next_messages(cursor).await {
Ok(stream) => stream,
Err(err) => {
error!("Failed to start Bedrock deposit stream: {err}");
tokio::time::sleep(poll_interval).await;
continue;
}
};
let mut stream = std::pin::pin!(stream);
while let Some((msg, slot)) = stream.next().await {
cursor = Some((dummy_msg_id, slot));
match msg {
ZoneMessage::Block(block) => {
info!("Observed Bedrock channel block id {:?}", block.id);
}
ZoneMessage::Deposit(deposit) => {
let metadata = match DepositMetadata::decode(&deposit.metadata) {
Ok(metadata) => metadata,
Err(err) => {
warn!("Skipping Bedrock Deposit with invalid metadata: {err}");
continue;
}
};
let tx = match build_bridge_deposit_tx(&metadata) {
Ok(tx) => tx,
Err(err) => {
warn!("Skipping Bedrock Deposit due to tx build failure: {err:#}");
continue;
}
};
info!(
"Observed Bedrock Deposit for recipient {recipient_id}, pushing to mempool",
recipient_id = metadata.recipient_id
);
mempool_handle
.push((TransactionOrigin::Sequencer, tx))
.await
.context("Mempool is closed while pushing Bedrock Deposit transaction")?;
}
ZoneMessage::Withdraw(_) => {}
}
}
tokio::time::sleep(poll_interval).await;
}
}
#[cfg(not(feature = "standalone"))]
fn build_bridge_deposit_tx(metadata: &DepositMetadata) -> Result<NSSATransaction> {
// TODO: Remove this constant once we have a way to get the deposit amount from Bedrock deposit
// inputs.
const TEMPORARY_BRIDGE_DEPOSIT_AMOUNT: u128 = 1;
let bridge_program_id = nssa::program::Program::bridge().id();
let vault_program_id = nssa::program::Program::vault().id();
let recipient_vault_id =
vault_core::compute_vault_account_id(vault_program_id, metadata.recipient_id);
let message = nssa::public_transaction::Message::try_new(
bridge_program_id,
vec![nssa::system_bridge_account_id(), recipient_vault_id],
vec![],
bridge_core::Instruction::Deposit {
vault_program_id,
recipient_id: metadata.recipient_id,
amount: TEMPORARY_BRIDGE_DEPOSIT_AMOUNT,
},
)
.context("Failed to build bridge deposit message")?;
let witness_set = nssa::public_transaction::WitnessSet::from_raw_parts(vec![]);
Ok(NSSATransaction::Public(nssa::PublicTransaction::new(
message,
witness_set,
)))
}