From 654e92f0d703d465f598bb7a8ec8992747d8125a Mon Sep 17 00:00:00 2001 From: Sergio Chouhy Date: Mon, 19 Jan 2026 14:26:48 -0300 Subject: [PATCH 1/9] clippy --- sequencer_core/src/block_settlement_client.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/sequencer_core/src/block_settlement_client.rs b/sequencer_core/src/block_settlement_client.rs index 68a95dd3..c1af22f4 100644 --- a/sequencer_core/src/block_settlement_client.rs +++ b/sequencer_core/src/block_settlement_client.rs @@ -87,9 +87,8 @@ impl BlockSettlementClient { .post_transaction(self.bedrock_node_url.clone(), tx.clone()) .await?; - match tx.mantle_tx.ops.first() { - Some(Op::ChannelInscribe(inscribe)) => self.last_message_id = inscribe.id(), - _ => {} + if let Some(Op::ChannelInscribe(inscribe)) = tx.mantle_tx.ops.first() { + self.last_message_id = inscribe.id(); } Ok(block_data.block_id) From 66d01d69d72565a1a77d7def95069b2cba7fcc84 Mon Sep 17 00:00:00 2001 From: Pravdyvy Date: Tue, 20 Jan 2026 10:26:22 +0200 Subject: [PATCH 2/9] fix: dep fix --- Cargo.lock | 333 +++++++++++++++++++++++++++++++++++--- Cargo.toml | 2 +- bedrock_client/src/lib.rs | 2 +- 3 files changed, 311 insertions(+), 26 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 9ccc65b4..00c7c418 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -367,6 +367,15 @@ version = "1.0.100" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a23eb6b1614318a8071c9b2521f36b424b2c83db5eb3a0fead4a6c0809af6e61" +[[package]] +name = "archery" +version = "1.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70e0a5f99dfebb87bb342d0f53bb92c81842e100bbb915223e38349580e5441d" +dependencies = [ + "triomphe", +] + [[package]] name = "ark-bls12-381" version = "0.4.0" @@ -1098,7 +1107,7 @@ dependencies = [ [[package]] name = "broadcast-service" version = "0.1.0" -source = "git+https://github.com/logos-blockchain/logos-blockchain.git?branch=feat-skip-zk-build#fde542bb8398189fe5e9bad688a527618261f63d" +source = "git+https://github.com/logos-blockchain/logos-blockchain.git#0e88327ca7faa705dd4498316ad48caadb5b8b4e" dependencies = [ "async-trait", "derivative", @@ -1267,6 +1276,36 @@ dependencies = [ "cpufeatures", ] +[[package]] +name = "chain-service" +version = "0.1.0" +source = "git+https://github.com/logos-blockchain/logos-blockchain.git#0e88327ca7faa705dd4498316ad48caadb5b8b4e" +dependencies = [ + "async-trait", + "broadcast-service", + "bytes", + "cryptarchia-engine", + "cryptarchia-sync", + "futures", + "groth16", + "nomos-core", + "nomos-ledger", + "nomos-network", + "nomos-storage", + "nomos-time", + "nomos-utils", + "num-bigint", + "overwatch", + "serde", + "serde_with", + "services-utils", + "strum", + "thiserror 1.0.69", + "tokio", + "tracing", + "tracing-futures", +] + [[package]] name = "chrono" version = "0.4.42" @@ -1294,7 +1333,7 @@ dependencies = [ [[package]] name = "circuits-prover" version = "0.1.0" -source = "git+https://github.com/logos-blockchain/logos-blockchain.git?branch=feat-skip-zk-build#fde542bb8398189fe5e9bad688a527618261f63d" +source = "git+https://github.com/logos-blockchain/logos-blockchain.git#0e88327ca7faa705dd4498316ad48caadb5b8b4e" dependencies = [ "circuits-utils", "tempfile", @@ -1303,7 +1342,7 @@ dependencies = [ [[package]] name = "circuits-utils" version = "0.1.0" -source = "git+https://github.com/logos-blockchain/logos-blockchain.git?branch=feat-skip-zk-build#fde542bb8398189fe5e9bad688a527618261f63d" +source = "git+https://github.com/logos-blockchain/logos-blockchain.git#0e88327ca7faa705dd4498316ad48caadb5b8b4e" dependencies = [ "dirs", ] @@ -1395,9 +1434,10 @@ dependencies = [ [[package]] name = "common-http-client" version = "0.1.0" -source = "git+https://github.com/logos-blockchain/logos-blockchain.git?branch=feat-skip-zk-build#fde542bb8398189fe5e9bad688a527618261f63d" +source = "git+https://github.com/logos-blockchain/logos-blockchain.git#0e88327ca7faa705dd4498316ad48caadb5b8b4e" dependencies = [ "broadcast-service", + "chain-service", "futures", "nomos-core", "nomos-da-messages", @@ -1452,6 +1492,15 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6245d59a3e82a7fc217c5828a6692dbc6dfb63a0c8c90495621f7b9d79704a0e" +[[package]] +name = "convert_case" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baaaa0ecca5b51987b9423ccdc971514dd8b0bb7b4060b983d3664dad3f1f89f" +dependencies = [ + "unicode-segmentation", +] + [[package]] name = "convert_case" version = "0.10.0" @@ -1530,7 +1579,7 @@ checksum = "460fbee9c2c2f33933d720630a6a0bac33ba7053db5344fac858d4b8952d77d5" [[package]] name = "cryptarchia-engine" version = "0.1.0" -source = "git+https://github.com/logos-blockchain/logos-blockchain.git?branch=feat-skip-zk-build#fde542bb8398189fe5e9bad688a527618261f63d" +source = "git+https://github.com/logos-blockchain/logos-blockchain.git#0e88327ca7faa705dd4498316ad48caadb5b8b4e" dependencies = [ "cfg_eval", "nomos-utils", @@ -1538,6 +1587,24 @@ dependencies = [ "serde_with", "thiserror 1.0.69", "time", + "tokio", + "tracing", +] + +[[package]] +name = "cryptarchia-sync" +version = "0.1.0" +source = "git+https://github.com/logos-blockchain/logos-blockchain.git#0e88327ca7faa705dd4498316ad48caadb5b8b4e" +dependencies = [ + "bytes", + "cryptarchia-engine", + "futures", + "nomos-core", + "rand 0.8.5", + "serde", + "serde_with", + "thiserror 1.0.69", + "tokio", "tracing", ] @@ -2344,7 +2411,7 @@ dependencies = [ [[package]] name = "groth16" version = "0.1.0" -source = "git+https://github.com/logos-blockchain/logos-blockchain.git?branch=feat-skip-zk-build#fde542bb8398189fe5e9bad688a527618261f63d" +source = "git+https://github.com/logos-blockchain/logos-blockchain.git#0e88327ca7faa705dd4498316ad48caadb5b8b4e" dependencies = [ "ark-bn254 0.4.0", "ark-ec 0.4.2", @@ -3015,7 +3082,7 @@ dependencies = [ [[package]] name = "key-management-system-keys" version = "0.1.0" -source = "git+https://github.com/logos-blockchain/logos-blockchain.git?branch=feat-skip-zk-build#fde542bb8398189fe5e9bad688a527618261f63d" +source = "git+https://github.com/logos-blockchain/logos-blockchain.git#0e88327ca7faa705dd4498316ad48caadb5b8b4e" dependencies = [ "async-trait", "bytes", @@ -3033,6 +3100,7 @@ dependencies = [ "thiserror 2.0.17", "tokio", "tracing", + "x25519-dalek", "zeroize", "zksign", ] @@ -3040,7 +3108,7 @@ dependencies = [ [[package]] name = "key-management-system-macros" version = "0.1.0" -source = "git+https://github.com/logos-blockchain/logos-blockchain.git?branch=feat-skip-zk-build#fde542bb8398189fe5e9bad688a527618261f63d" +source = "git+https://github.com/logos-blockchain/logos-blockchain.git#0e88327ca7faa705dd4498316ad48caadb5b8b4e" dependencies = [ "proc-macro2", "quote", @@ -3071,7 +3139,7 @@ dependencies = [ [[package]] name = "kzgrs" version = "0.1.0" -source = "git+https://github.com/logos-blockchain/logos-blockchain.git?branch=feat-skip-zk-build#fde542bb8398189fe5e9bad688a527618261f63d" +source = "git+https://github.com/logos-blockchain/logos-blockchain.git#0e88327ca7faa705dd4498316ad48caadb5b8b4e" dependencies = [ "ark-bls12-381", "ark-ec 0.4.2", @@ -3090,7 +3158,7 @@ dependencies = [ [[package]] name = "kzgrs-backend" version = "0.1.0" -source = "git+https://github.com/logos-blockchain/logos-blockchain.git?branch=feat-skip-zk-build#fde542bb8398189fe5e9bad688a527618261f63d" +source = "git+https://github.com/logos-blockchain/logos-blockchain.git#0e88327ca7faa705dd4498316ad48caadb5b8b4e" dependencies = [ "ark-ff 0.4.2", "ark-poly 0.4.2", @@ -3172,6 +3240,7 @@ dependencies = [ "bs58", "hkdf", "multihash", + "serde", "sha2", "thiserror 2.0.17", "tracing", @@ -3374,6 +3443,18 @@ dependencies = [ "windows-sys 0.61.2", ] +[[package]] +name = "mmr" +version = "0.1.0" +source = "git+https://github.com/logos-blockchain/logos-blockchain.git#0e88327ca7faa705dd4498316ad48caadb5b8b4e" +dependencies = [ + "ark-ff 0.4.2", + "groth16", + "poseidon2", + "rpds", + "serde", +] + [[package]] name = "multiaddr" version = "0.18.2" @@ -3483,7 +3564,7 @@ dependencies = [ [[package]] name = "nomos-blend-crypto" version = "0.1.0" -source = "git+https://github.com/logos-blockchain/logos-blockchain.git?branch=feat-skip-zk-build#fde542bb8398189fe5e9bad688a527618261f63d" +source = "git+https://github.com/logos-blockchain/logos-blockchain.git#0e88327ca7faa705dd4498316ad48caadb5b8b4e" dependencies = [ "blake2", "groth16", @@ -3491,17 +3572,35 @@ dependencies = [ "poq", "poseidon2", "rs-merkle-tree", - "serde", - "subtle", "thiserror 1.0.69", - "x25519-dalek", +] + +[[package]] +name = "nomos-blend-message" +version = "0.1.0" +source = "git+https://github.com/logos-blockchain/logos-blockchain.git#0e88327ca7faa705dd4498316ad48caadb5b8b4e" +dependencies = [ + "blake2", + "derivative", + "groth16", + "itertools 0.14.0", + "key-management-system-keys", + "nomos-blend-crypto", + "nomos-blend-proofs", + "nomos-core", + "nomos-utils", + "serde", + "serde-big-array", + "serde_with", + "thiserror 1.0.69", + "tracing", "zeroize", ] [[package]] name = "nomos-blend-proofs" version = "0.1.0" -source = "git+https://github.com/logos-blockchain/logos-blockchain.git?branch=feat-skip-zk-build#fde542bb8398189fe5e9bad688a527618261f63d" +source = "git+https://github.com/logos-blockchain/logos-blockchain.git#0e88327ca7faa705dd4498316ad48caadb5b8b4e" dependencies = [ "ed25519-dalek", "generic-array 1.3.5", @@ -3516,7 +3615,7 @@ dependencies = [ [[package]] name = "nomos-core" version = "0.1.0" -source = "git+https://github.com/logos-blockchain/logos-blockchain.git?branch=feat-skip-zk-build#fde542bb8398189fe5e9bad688a527618261f63d" +source = "git+https://github.com/logos-blockchain/logos-blockchain.git#0e88327ca7faa705dd4498316ad48caadb5b8b4e" dependencies = [ "ark-ff 0.4.2", "async-trait", @@ -3546,7 +3645,7 @@ dependencies = [ [[package]] name = "nomos-da-messages" version = "0.1.0" -source = "git+https://github.com/logos-blockchain/logos-blockchain.git?branch=feat-skip-zk-build#fde542bb8398189fe5e9bad688a527618261f63d" +source = "git+https://github.com/logos-blockchain/logos-blockchain.git#0e88327ca7faa705dd4498316ad48caadb5b8b4e" dependencies = [ "blake2", "futures", @@ -3559,7 +3658,7 @@ dependencies = [ [[package]] name = "nomos-http-api-common" version = "0.1.0" -source = "git+https://github.com/logos-blockchain/logos-blockchain.git?branch=feat-skip-zk-build#fde542bb8398189fe5e9bad688a527618261f63d" +source = "git+https://github.com/logos-blockchain/logos-blockchain.git#0e88327ca7faa705dd4498316ad48caadb5b8b4e" dependencies = [ "axum", "governor", @@ -3571,10 +3670,86 @@ dependencies = [ "tower_governor", ] +[[package]] +name = "nomos-ledger" +version = "0.1.0" +source = "git+https://github.com/logos-blockchain/logos-blockchain.git#0e88327ca7faa705dd4498316ad48caadb5b8b4e" +dependencies = [ + "cryptarchia-engine", + "groth16", + "key-management-system-keys", + "mmr", + "nomos-blend-crypto", + "nomos-blend-message", + "nomos-blend-proofs", + "nomos-core", + "nomos-utils", + "num-bigint", + "rand 0.8.5", + "rpds", + "serde", + "thiserror 1.0.69", + "tracing", + "utxotree", +] + +[[package]] +name = "nomos-network" +version = "0.1.0" +source = "git+https://github.com/logos-blockchain/logos-blockchain.git#0e88327ca7faa705dd4498316ad48caadb5b8b4e" +dependencies = [ + "async-trait", + "cryptarchia-sync", + "futures", + "nomos-core", + "overwatch", + "serde", + "tokio", + "tokio-stream", + "tracing", +] + +[[package]] +name = "nomos-storage" +version = "0.1.0" +source = "git+https://github.com/logos-blockchain/logos-blockchain.git#0e88327ca7faa705dd4498316ad48caadb5b8b4e" +dependencies = [ + "async-trait", + "bytes", + "cryptarchia-engine", + "futures", + "libp2p-identity", + "multiaddr", + "nomos-core", + "overwatch", + "serde", + "thiserror 1.0.69", + "tokio", + "tracing", +] + +[[package]] +name = "nomos-time" +version = "0.1.0" +source = "git+https://github.com/logos-blockchain/logos-blockchain.git#0e88327ca7faa705dd4498316ad48caadb5b8b4e" +dependencies = [ + "async-trait", + "cryptarchia-engine", + "futures", + "log", + "overwatch", + "sntpc", + "thiserror 2.0.17", + "time", + "tokio", + "tokio-stream", + "tracing", +] + [[package]] name = "nomos-utils" version = "0.1.0" -source = "git+https://github.com/logos-blockchain/logos-blockchain.git?branch=feat-skip-zk-build#fde542bb8398189fe5e9bad688a527618261f63d" +source = "git+https://github.com/logos-blockchain/logos-blockchain.git#0e88327ca7faa705dd4498316ad48caadb5b8b4e" dependencies = [ "async-trait", "blake2", @@ -3826,6 +4001,7 @@ source = "git+https://github.com/logos-co/Overwatch?rev=f5a9902#f5a99022f389d65a dependencies = [ "async-trait", "futures", + "overwatch-derive", "thiserror 2.0.17", "tokio", "tokio-stream", @@ -3833,6 +4009,18 @@ dependencies = [ "tracing", ] +[[package]] +name = "overwatch-derive" +version = "0.1.0" +source = "git+https://github.com/logos-co/Overwatch?rev=f5a9902#f5a99022f389d65adbd55e51f1e3f9eead62432a" +dependencies = [ + "convert_case 0.8.0", + "proc-macro-error2", + "proc-macro2", + "quote", + "syn 2.0.111", +] + [[package]] name = "parking_lot" version = "0.12.5" @@ -3939,7 +4127,7 @@ checksum = "7edddbd0b52d732b21ad9a5fab5c704c14cd949e5e9a1ec5929a24fded1b904c" [[package]] name = "pol" version = "0.1.0" -source = "git+https://github.com/logos-blockchain/logos-blockchain.git?branch=feat-skip-zk-build#fde542bb8398189fe5e9bad688a527618261f63d" +source = "git+https://github.com/logos-blockchain/logos-blockchain.git#0e88327ca7faa705dd4498316ad48caadb5b8b4e" dependencies = [ "circuits-prover", "circuits-utils", @@ -3967,7 +4155,7 @@ dependencies = [ [[package]] name = "poq" version = "0.1.0" -source = "git+https://github.com/logos-blockchain/logos-blockchain.git?branch=feat-skip-zk-build#fde542bb8398189fe5e9bad688a527618261f63d" +source = "git+https://github.com/logos-blockchain/logos-blockchain.git#0e88327ca7faa705dd4498316ad48caadb5b8b4e" dependencies = [ "circuits-prover", "circuits-utils", @@ -3989,7 +4177,7 @@ checksum = "f84267b20a16ea918e43c6a88433c2d54fa145c92a811b5b047ccbe153674483" [[package]] name = "poseidon2" version = "0.1.0" -source = "git+https://github.com/logos-blockchain/logos-blockchain.git?branch=feat-skip-zk-build#fde542bb8398189fe5e9bad688a527618261f63d" +source = "git+https://github.com/logos-blockchain/logos-blockchain.git#0e88327ca7faa705dd4498316ad48caadb5b8b4e" dependencies = [ "ark-bn254 0.4.0", "ark-ff 0.4.2", @@ -4042,6 +4230,28 @@ dependencies = [ "toml_edit 0.23.10+spec-1.0.0", ] +[[package]] +name = "proc-macro-error-attr2" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96de42df36bb9bba5542fe9f1a054b8cc87e172759a1868aa05c1f3acc89dfc5" +dependencies = [ + "proc-macro2", + "quote", +] + +[[package]] +name = "proc-macro-error2" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "11ec05c52be0a07b08061f7dd003e7d7092e0472bc731b4af7bb1ef876109802" +dependencies = [ + "proc-macro-error-attr2", + "proc-macro2", + "quote", + "syn 2.0.111", +] + [[package]] name = "proc-macro2" version = "1.0.103" @@ -4660,6 +4870,16 @@ dependencies = [ "librocksdb-sys", ] +[[package]] +name = "rpds" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e75f485e819d4d3015e6c0d55d02a4fd3db47c1993d9e603e0361fba2bffb34" +dependencies = [ + "archery", + "serde", +] + [[package]] name = "rrs-lib" version = "0.1.0" @@ -5002,6 +5222,15 @@ dependencies = [ "serde_derive", ] +[[package]] +name = "serde-big-array" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "11fc7cc2c76d73e0f27ee52abbd64eec84d46f370c88371120433196934e4b7f" +dependencies = [ + "serde", +] + [[package]] name = "serde_core" version = "1.0.228" @@ -5108,6 +5337,21 @@ dependencies = [ "serde", ] +[[package]] +name = "services-utils" +version = "0.1.0" +source = "git+https://github.com/logos-blockchain/logos-blockchain.git#0e88327ca7faa705dd4498316ad48caadb5b8b4e" +dependencies = [ + "async-trait", + "futures", + "log", + "overwatch", + "serde", + "serde_json", + "thiserror 1.0.69", + "tracing", +] + [[package]] name = "sha1" version = "0.10.6" @@ -5167,6 +5411,16 @@ version = "1.15.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "67b1b7a3b5fe4f1376887184045fcf45c69e92af734b7aaddc05fb777b6fbd03" +[[package]] +name = "sntpc" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78f778a0f82b3cf5d75f858eceee38e84d5292f1d03415e88cc4ec45ca6ba8a2" +dependencies = [ + "cfg-if", + "tokio", +] + [[package]] name = "socket2" version = "0.4.10" @@ -5751,6 +6005,16 @@ dependencies = [ "valuable", ] +[[package]] +name = "tracing-futures" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97d095ae15e245a057c8e8451bab9b3ee1e1f68e9ba2b4fbc18d0ac5237835f2" +dependencies = [ + "pin-project", + "tracing", +] + [[package]] name = "tracing-subscriber" version = "0.2.25" @@ -5760,6 +6024,12 @@ dependencies = [ "tracing-core", ] +[[package]] +name = "triomphe" +version = "0.1.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd69c5aa8f924c7519d6372789a74eac5b94fb0f8fcf0d4a97eb0bfc3e785f39" + [[package]] name = "try-lock" version = "0.2.5" @@ -5863,6 +6133,21 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" +[[package]] +name = "utxotree" +version = "0.1.0" +source = "git+https://github.com/logos-blockchain/logos-blockchain.git#0e88327ca7faa705dd4498316ad48caadb5b8b4e" +dependencies = [ + "ark-ff 0.4.2", + "groth16", + "nomos-core", + "num-bigint", + "poseidon2", + "rpds", + "serde", + "thiserror 1.0.69", +] + [[package]] name = "valuable" version = "0.1.1" @@ -6310,7 +6595,7 @@ checksum = "f17a85883d4e6d00e8a97c586de764dabcc06133f7f1d55dce5cdc070ad7fe59" [[package]] name = "witness-generator" version = "0.1.0" -source = "git+https://github.com/logos-blockchain/logos-blockchain.git?branch=feat-skip-zk-build#fde542bb8398189fe5e9bad688a527618261f63d" +source = "git+https://github.com/logos-blockchain/logos-blockchain.git#0e88327ca7faa705dd4498316ad48caadb5b8b4e" dependencies = [ "circuits-utils", "tempfile", @@ -6465,7 +6750,7 @@ dependencies = [ [[package]] name = "zksign" version = "0.1.0" -source = "git+https://github.com/logos-blockchain/logos-blockchain.git?branch=feat-skip-zk-build#fde542bb8398189fe5e9bad688a527618261f63d" +source = "git+https://github.com/logos-blockchain/logos-blockchain.git#0e88327ca7faa705dd4498316ad48caadb5b8b4e" dependencies = [ "circuits-prover", "circuits-utils", diff --git a/Cargo.toml b/Cargo.toml index 30b4576a..eed73b7c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -78,7 +78,7 @@ base58 = "0.2.0" itertools = "0.14.0" url = "2.5.4" -common-http-client = { git = "https://github.com/logos-blockchain/logos-blockchain.git", branch = "feat-skip-zk-build" } +common-http-client = { git = "https://github.com/logos-blockchain/logos-blockchain.git" } rocksdb = { version = "0.24.0", default-features = false, features = [ "snappy", diff --git a/bedrock_client/src/lib.rs b/bedrock_client/src/lib.rs index 9315f083..36a3ac7a 100644 --- a/bedrock_client/src/lib.rs +++ b/bedrock_client/src/lib.rs @@ -10,7 +10,7 @@ pub struct BedrockClient(pub CommonHttpClient); impl BedrockClient { pub fn new(auth: Option) -> Result { let client = Client::builder() - //Add more fiedls if needed + //Add more fields if needed .timeout(std::time::Duration::from_secs(60)) .build()?; From e397d6c5766ccb76cc3cb0b5f511612ccc0e89db Mon Sep 17 00:00:00 2001 From: Sergio Chouhy Date: Tue, 20 Jan 2026 11:50:20 -0300 Subject: [PATCH 3/9] add bedrock status flag to blocks and last_finalized_block metadata info to sequencer db --- common/src/block.rs | 17 +++++++++--- common/src/test_utils.rs | 2 +- sequencer_core/src/block_store.rs | 4 +-- sequencer_core/src/lib.rs | 4 +-- storage/src/lib.rs | 45 +++++++++++++++++++++++-------- 5 files changed, 52 insertions(+), 20 deletions(-) diff --git a/common/src/block.rs b/common/src/block.rs index 944b8989..84b7a419 100644 --- a/common/src/block.rs +++ b/common/src/block.rs @@ -23,7 +23,7 @@ pub type BlockHash = [u8; 32]; pub type BlockId = u64; pub type TimeStamp = u64; -#[derive(Debug, Clone)] +#[derive(Debug, Clone, BorshSerialize, BorshDeserialize)] pub struct BlockHeader { pub block_id: BlockId, pub prev_block_hash: BlockHash, @@ -32,15 +32,23 @@ pub struct BlockHeader { pub signature: nssa::Signature, } -#[derive(Debug, Clone)] +#[derive(Debug, Clone, BorshSerialize, BorshDeserialize)] pub struct BlockBody { pub transactions: Vec, } -#[derive(Debug, Clone)] +#[derive(Debug, Clone, BorshSerialize, BorshDeserialize)] +pub enum BedrockStatus { + Pending, + Safe, + Finalized, +} + +#[derive(Debug, BorshSerialize, BorshDeserialize)] pub struct Block { pub header: BlockHeader, pub body: BlockBody, + pub bedrock_status: BedrockStatus, } #[derive(Debug, Clone, PartialEq, Eq, BorshSerialize, BorshDeserialize)] @@ -52,7 +60,7 @@ pub struct HashableBlockData { } impl HashableBlockData { - pub fn into_block(self, signing_key: &nssa::PrivateKey) -> Block { + pub fn into_pending_block(self, signing_key: &nssa::PrivateKey) -> Block { let data_bytes = borsh::to_vec(&self).unwrap(); let signature = nssa::Signature::new(signing_key, &data_bytes); let hash = OwnHasher::hash(&data_bytes); @@ -67,6 +75,7 @@ impl HashableBlockData { body: BlockBody { transactions: self.transactions, }, + bedrock_status: BedrockStatus::Pending, } } } diff --git a/common/src/test_utils.rs b/common/src/test_utils.rs index 7e3c0ba8..1125b86e 100644 --- a/common/src/test_utils.rs +++ b/common/src/test_utils.rs @@ -30,7 +30,7 @@ pub fn produce_dummy_block( transactions, }; - block_data.into_block(&sequencer_sign_key_for_testing()) + block_data.into_pending_block(&sequencer_sign_key_for_testing()) } pub fn produce_dummy_empty_transaction() -> EncodedTransaction { diff --git a/sequencer_core/src/block_store.rs b/sequencer_core/src/block_store.rs index 67535022..cd9aa194 100644 --- a/sequencer_core/src/block_store.rs +++ b/sequencer_core/src/block_store.rs @@ -46,7 +46,7 @@ impl SequencerBlockStore { } pub fn get_block_at_id(&self, id: u64) -> Result { - Ok(self.dbio.get_block(id)?.into_block(&self.signing_key)) + Ok(self.dbio.get_block(id)?) } pub fn put_block_at_id(&mut self, block: Block) -> Result<()> { @@ -113,7 +113,7 @@ mod tests { transactions: vec![], }; - let genesis_block = genesis_block_hashable_data.into_block(&signing_key); + let genesis_block = genesis_block_hashable_data.into_pending_block(&signing_key); // Start an empty node store let mut node_store = SequencerBlockStore::open_db_with_genesis(path, Some(genesis_block), signing_key) diff --git a/sequencer_core/src/lib.rs b/sequencer_core/src/lib.rs index 561f5ef6..a7a16826 100644 --- a/sequencer_core/src/lib.rs +++ b/sequencer_core/src/lib.rs @@ -53,7 +53,7 @@ impl SequencerCore { }; let signing_key = nssa::PrivateKey::try_new(config.signing_key).unwrap(); - let genesis_block = hashable_data.into_block(&signing_key); + let genesis_block = hashable_data.into_pending_block(&signing_key); // Sequencer should panic if unable to open db, // as fixing this issue may require actions non-native to program scope @@ -196,7 +196,7 @@ impl SequencerCore { let block = hashable_data .clone() - .into_block(self.block_store.signing_key()); + .into_pending_block(self.block_store.signing_key()); self.block_store.put_block_at_id(block)?; diff --git a/storage/src/lib.rs b/storage/src/lib.rs index 87b78705..883684c2 100644 --- a/storage/src/lib.rs +++ b/storage/src/lib.rs @@ -1,6 +1,6 @@ use std::{path::Path, sync::Arc}; -use common::block::{Block, HashableBlockData}; +use common::block::Block; use error::DbError; use rocksdb::{ BoundColumnFamily, ColumnFamilyDescriptor, DBWithThreadMode, MultiThreaded, Options, @@ -26,6 +26,8 @@ pub const DB_META_FIRST_BLOCK_IN_DB_KEY: &str = "first_block_in_db"; pub const DB_META_LAST_BLOCK_IN_DB_KEY: &str = "last_block_in_db"; /// Key base for storing metainformation which describe if first block has been set pub const DB_META_FIRST_BLOCK_SET_KEY: &str = "first_block_set"; +/// Key base for storing metainformation about the last finalized block on Bedrock +pub const DB_META_LAST_FINALIZED_BLOCK_ID: &str = "last_finalized_block_id"; /// Key base for storing snapshot which describe block id pub const DB_SNAPSHOT_BLOCK_ID_KEY: &str = "block_id"; @@ -75,6 +77,7 @@ impl RocksDBIO { dbio.put_meta_first_block_in_db(block)?; dbio.put_meta_is_first_block_set()?; dbio.put_meta_last_block_in_db(block_id)?; + dbio.put_meta_last_finalized_block_id(None)?; Ok(dbio) } else { @@ -232,6 +235,28 @@ impl RocksDBIO { Ok(()) } + pub fn put_meta_last_finalized_block_id(&self, block_id: Option) -> DbResult<()> { + let cf_meta = self.meta_column(); + self.db + .put_cf( + &cf_meta, + borsh::to_vec(&DB_META_LAST_FINALIZED_BLOCK_ID).map_err(|err| { + DbError::borsh_cast_message( + err, + Some("Failed to serialize DB_META_LAST_FINALIZED_BLOCK_ID".to_string()), + ) + })?, + borsh::to_vec(&block_id).map_err(|err| { + DbError::borsh_cast_message( + err, + Some("Failed to serialize last block id".to_string()), + ) + })?, + ) + .map_err(|rerr| DbError::rocksdb_cast_message(rerr, None))?; + Ok(()) + } + pub fn put_meta_is_first_block_set(&self) -> DbResult<()> { let cf_meta = self.meta_column(); self.db @@ -269,7 +294,7 @@ impl RocksDBIO { Some("Failed to serialize block id".to_string()), ) })?, - borsh::to_vec(&HashableBlockData::from(block)).map_err(|err| { + borsh::to_vec(&block).map_err(|err| { DbError::borsh_cast_message( err, Some("Failed to serialize block data".to_string()), @@ -280,7 +305,7 @@ impl RocksDBIO { Ok(()) } - pub fn get_block(&self, block_id: u64) -> DbResult { + pub fn get_block(&self, block_id: u64) -> DbResult { let cf_block = self.block_column(); let res = self .db @@ -296,14 +321,12 @@ impl RocksDBIO { .map_err(|rerr| DbError::rocksdb_cast_message(rerr, None))?; if let Some(data) = res { - Ok( - borsh::from_slice::(&data).map_err(|serr| { - DbError::borsh_cast_message( - serr, - Some("Failed to deserialize block data".to_string()), - ) - })?, - ) + Ok(borsh::from_slice::(&data).map_err(|serr| { + DbError::borsh_cast_message( + serr, + Some("Failed to deserialize block data".to_string()), + ) + })?) } else { Err(DbError::db_interaction_error( "Block on this id not found".to_string(), From 56295d12d86a478bb8d6c4cbd4687cb3357fdf3c Mon Sep 17 00:00:00 2001 From: Sergio Chouhy Date: Wed, 21 Jan 2026 10:38:18 -0300 Subject: [PATCH 4/9] use anyhow for block settlement client error handling --- sequencer_core/src/block_settlement_client.rs | 20 ++++++++----------- sequencer_core/src/config.rs | 3 ++- 2 files changed, 10 insertions(+), 13 deletions(-) diff --git a/sequencer_core/src/block_settlement_client.rs b/sequencer_core/src/block_settlement_client.rs index c1af22f4..e14b1b47 100644 --- a/sequencer_core/src/block_settlement_client.rs +++ b/sequencer_core/src/block_settlement_client.rs @@ -1,6 +1,6 @@ use std::{fs, path::Path}; -use anyhow::Result; +use anyhow::{Result, anyhow}; use bedrock_client::BedrockClient; use common::block::HashableBlockData; use key_management_system_service::keys::{ED25519_SECRET_KEY_SIZE, Ed25519Key, Ed25519PublicKey}; @@ -25,8 +25,7 @@ impl BlockSettlementClient { pub fn new(home: &Path, config: &BedrockConfig) -> Self { let bedrock_signing_key = load_or_create_signing_key(&home.join("bedrock_signing_key")) .expect("Signing key should load or be created successfully"); - let bedrock_node_url = - Url::parse(&config.node_url).expect("Bedrock URL should be a valid URL"); + let bedrock_node_url = config.node_url.clone(); let bedrock_channel_id = ChannelId::from(config.channel_id); let bedrock_client = BedrockClient::new(None).expect("Bedrock client should be able to initialize"); @@ -96,20 +95,17 @@ impl BlockSettlementClient { } /// Load signing key from file or generate a new one if it doesn't exist -fn load_or_create_signing_key(path: &Path) -> Result { +fn load_or_create_signing_key(path: &Path) -> Result { if path.exists() { - let key_bytes = fs::read(path).map_err(|_| ())?; - if key_bytes.len() != ED25519_SECRET_KEY_SIZE { - // TODO: proper error - return Err(()); - } - let key_array: [u8; ED25519_SECRET_KEY_SIZE] = - key_bytes.try_into().expect("length already checked"); + let key_bytes = fs::read(path)?; + let key_array: [u8; ED25519_SECRET_KEY_SIZE] = key_bytes + .try_into() + .map_err(|_| anyhow!("Found key with incorrect length"))?; Ok(Ed25519Key::from_bytes(&key_array)) } else { let mut key_bytes = [0u8; ED25519_SECRET_KEY_SIZE]; rand::RngCore::fill_bytes(&mut rand::thread_rng(), &mut key_bytes); - fs::write(path, key_bytes).map_err(|_| ())?; + fs::write(path, key_bytes)?; Ok(Ed25519Key::from_bytes(&key_bytes)) } } diff --git a/sequencer_core/src/config.rs b/sequencer_core/src/config.rs index ed42fa3a..5911cc52 100644 --- a/sequencer_core/src/config.rs +++ b/sequencer_core/src/config.rs @@ -5,6 +5,7 @@ use std::{ }; use anyhow::Result; +use reqwest::Url; use serde::{Deserialize, Serialize}; #[derive(Debug, Serialize, Deserialize, Clone)] @@ -56,7 +57,7 @@ pub struct BedrockConfig { /// Bedrock channel ID pub channel_id: [u8; 32], /// Bedrock Url - pub node_url: String, + pub node_url: Url, } impl SequencerConfig { From f04b299b1ab2e49221e585ac585cd5192e521629 Mon Sep 17 00:00:00 2001 From: Sergio Chouhy Date: Wed, 21 Jan 2026 11:47:28 -0300 Subject: [PATCH 5/9] minor changes --- Cargo.lock | 1 + bedrock_client/Cargo.toml | 1 + bedrock_client/src/lib.rs | 24 +++++++++--- sequencer_core/src/block_settlement_client.rs | 39 ++++++++----------- sequencer_core/src/lib.rs | 12 +++--- 5 files changed, 42 insertions(+), 35 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 4c543c49..2b5e93cd 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -957,6 +957,7 @@ version = "0.1.0" dependencies = [ "anyhow", "common-http-client", + "nomos-core", "reqwest", ] diff --git a/bedrock_client/Cargo.toml b/bedrock_client/Cargo.toml index 034a093e..e6f6f02a 100644 --- a/bedrock_client/Cargo.toml +++ b/bedrock_client/Cargo.toml @@ -7,3 +7,4 @@ edition = "2024" reqwest.workspace = true anyhow.workspace = true common-http-client.workspace = true +nomos-core.workspace = true diff --git a/bedrock_client/src/lib.rs b/bedrock_client/src/lib.rs index 9315f083..a5e0a049 100644 --- a/bedrock_client/src/lib.rs +++ b/bedrock_client/src/lib.rs @@ -1,21 +1,33 @@ use anyhow::Result; use common_http_client::CommonHttpClient; pub use common_http_client::{BasicAuthCredentials, Error}; -use reqwest::Client; +use nomos_core::mantle::SignedMantleTx; +use reqwest::{Client, Url}; // Simple wrapper // maybe extend in the future for our purposes -pub struct BedrockClient(pub CommonHttpClient); +pub struct BedrockClient { + http_client: CommonHttpClient, + node_url: Url, +} impl BedrockClient { - pub fn new(auth: Option) -> Result { + pub fn new(auth: Option, node_url: Url) -> Result { let client = Client::builder() //Add more fiedls if needed .timeout(std::time::Duration::from_secs(60)) .build()?; - Ok(BedrockClient(CommonHttpClient::new_with_client( - client, auth, - ))) + let http_client = CommonHttpClient::new_with_client(client, auth); + Ok(Self { + http_client, + node_url, + }) + } + + pub async fn post_transaction(&self, tx: SignedMantleTx) -> Result<(), Error> { + self.http_client + .post_transaction(self.node_url.clone(), tx) + .await } } diff --git a/sequencer_core/src/block_settlement_client.rs b/sequencer_core/src/block_settlement_client.rs index e14b1b47..58f4d7f4 100644 --- a/sequencer_core/src/block_settlement_client.rs +++ b/sequencer_core/src/block_settlement_client.rs @@ -8,13 +8,11 @@ use nomos_core::mantle::{ MantleTx, Op, OpProof, SignedMantleTx, Transaction, TxHash, ledger, ops::channel::{ChannelId, MsgId, inscribe::InscriptionOp}, }; -use reqwest::Url; use crate::config::BedrockConfig; /// A component that posts block data to logos blockchain pub struct BlockSettlementClient { - bedrock_node_url: Url, bedrock_client: BedrockClient, bedrock_signing_key: Ed25519Key, bedrock_channel_id: ChannelId, @@ -22,24 +20,21 @@ pub struct BlockSettlementClient { } impl BlockSettlementClient { - pub fn new(home: &Path, config: &BedrockConfig) -> Self { - let bedrock_signing_key = load_or_create_signing_key(&home.join("bedrock_signing_key")) - .expect("Signing key should load or be created successfully"); - let bedrock_node_url = config.node_url.clone(); + pub fn try_new(home: &Path, config: &BedrockConfig) -> Result { + let bedrock_signing_key = load_or_create_signing_key(&home.join("bedrock_signing_key"))?; let bedrock_channel_id = ChannelId::from(config.channel_id); - let bedrock_client = - BedrockClient::new(None).expect("Bedrock client should be able to initialize"); - Self { - bedrock_node_url, + let bedrock_client = BedrockClient::new(None, config.node_url.clone())?; + let channel_genesis_msg = MsgId::from([0; 32]); + Ok(Self { bedrock_client, bedrock_signing_key, bedrock_channel_id, - last_message_id: MsgId::from([0; 32]), - } + last_message_id: channel_genesis_msg, + }) } /// Create and sign a transaction for inscribing data - pub fn create_inscribe_tx(&self, data: Vec) -> SignedMantleTx { + pub fn create_inscribe_tx(&self, data: Vec) -> (SignedMantleTx, MsgId) { let verifying_key_bytes = self.bedrock_signing_key.public_key().to_bytes(); let verifying_key = Ed25519PublicKey::from_bytes(&verifying_key_bytes).expect("valid ed25519 public key"); @@ -50,12 +45,14 @@ impl BlockSettlementClient { parent: self.last_message_id, signer: verifying_key, }; + let inscribe_op_id = inscribe_op.id(); let ledger_tx = ledger::Tx::new(vec![], vec![]); let inscribe_tx = MantleTx { ops: vec![Op::ChannelInscribe(inscribe_op)], ledger_tx, + // Altruistic test config storage_gas_price: 0, execution_gas_price: 0, }; @@ -68,27 +65,23 @@ impl BlockSettlementClient { let signature = key_management_system_service::keys::Ed25519Signature::from_bytes(&signature_bytes); - SignedMantleTx { + let signed_mantle_tx = SignedMantleTx { ops_proofs: vec![OpProof::Ed25519Sig(signature)], ledger_tx_proof: empty_ledger_signature(&tx_hash), mantle_tx: inscribe_tx, - } + }; + (signed_mantle_tx, inscribe_op_id) } /// Post a transaction to the node and wait for inclusion pub async fn post_and_wait(&mut self, block_data: &HashableBlockData) -> Result { let inscription_data = borsh::to_vec(&block_data)?; - let tx = self.create_inscribe_tx(inscription_data); + let (tx, new_msg_id) = self.create_inscribe_tx(inscription_data); // Post the transaction - self.bedrock_client - .0 - .post_transaction(self.bedrock_node_url.clone(), tx.clone()) - .await?; + self.bedrock_client.post_transaction(tx).await?; - if let Some(Op::ChannelInscribe(inscribe)) = tx.mantle_tx.ops.first() { - self.last_message_id = inscribe.id(); - } + self.last_message_id = new_msg_id; Ok(block_data.block_id) } diff --git a/sequencer_core/src/lib.rs b/sequencer_core/src/lib.rs index a7a16826..89cafc4c 100644 --- a/sequencer_core/src/lib.rs +++ b/sequencer_core/src/lib.rs @@ -89,10 +89,10 @@ impl SequencerCore { state.add_pinata_program(PINATA_BASE58.parse().unwrap()); let (mempool, mempool_handle) = MemPool::new(config.mempool_max_size); - let block_settlement = config - .bedrock_config - .as_ref() - .map(|bedrock_config| BlockSettlementClient::new(&config.home, bedrock_config)); + let block_settlement_client = config.bedrock_config.as_ref().map(|bedrock_config| { + BlockSettlementClient::try_new(&config.home, bedrock_config) + .expect("Block settlement client should be constructible") + }); let mut this = Self { state, @@ -100,7 +100,7 @@ impl SequencerCore { mempool, chain_height: config.genesis_id, sequencer_config: config, - block_settlement_client: block_settlement, + block_settlement_client, }; this.sync_state_with_stored_blocks(); @@ -203,7 +203,7 @@ impl SequencerCore { self.chain_height = new_block_height; // TODO: Consider switching to `tracing` crate to have more structured and consistent logs - // // e.g. + // e.g. // // ``` // info!( From a8f41838acc1e0a4cef1c835f6915bde0aa8839a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=A1clav=20Pavl=C3=ADn?= Date: Thu, 22 Jan 2026 09:29:54 +0100 Subject: [PATCH 6/9] bug(wallet): conflicting flag -h for transaction info --- wallet/src/cli/chain.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wallet/src/cli/chain.rs b/wallet/src/cli/chain.rs index 419fa5e2..17ecd020 100644 --- a/wallet/src/cli/chain.rs +++ b/wallet/src/cli/chain.rs @@ -19,7 +19,7 @@ pub enum ChainSubcommand { /// Get transaction at hash from sequencer Transaction { /// hash - valid 32 byte hex string - #[arg(short, long)] + #[arg(short = 't', long)] hash: String, }, } From 6e745494c2c6ad9f7a127f60b7fa5d9fb0182610 Mon Sep 17 00:00:00 2001 From: Daniil Polyakov Date: Mon, 26 Jan 2026 16:25:06 +0300 Subject: [PATCH 7/9] fix: install cargo-nextest with locked option --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 38161a0f..a8efedd9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -99,7 +99,7 @@ jobs: run: rustup install - name: Install nextest - run: cargo install cargo-nextest + run: cargo install --locked cargo-nextest - name: Run tests env: From 02702213dce649816c9ce6237984116763396564 Mon Sep 17 00:00:00 2001 From: Sergio Chouhy <41742639+schouhy@users.noreply.github.com> Date: Mon, 26 Jan 2026 13:34:38 -0300 Subject: [PATCH 8/9] Update sequencer_core/src/block_settlement_client.rs Co-authored-by: Daniil Polyakov --- sequencer_core/src/block_settlement_client.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sequencer_core/src/block_settlement_client.rs b/sequencer_core/src/block_settlement_client.rs index c41efa52..c0c727a8 100644 --- a/sequencer_core/src/block_settlement_client.rs +++ b/sequencer_core/src/block_settlement_client.rs @@ -23,9 +23,9 @@ pub struct BlockSettlementClient { impl BlockSettlementClient { pub fn try_new(home: &Path, config: &BedrockConfig) -> Result { - let bedrock_signing_key = load_or_create_signing_key(&home.join("bedrock_signing_key"))?; + let bedrock_signing_key = load_or_create_signing_key(&home.join("bedrock_signing_key")).context("Failed to load or create signing key")?; let bedrock_channel_id = ChannelId::from(config.channel_id); - let bedrock_client = BedrockClient::new(None, config.node_url.clone())?; + let bedrock_client = BedrockClient::new(None, config.node_url.clone()).context("Failed to initialize bedrock client")?; let channel_genesis_msg = MsgId::from([0; 32]); Ok(Self { bedrock_client, From e680544ca3dc1acb239900f0a3d00cd61396c070 Mon Sep 17 00:00:00 2001 From: Sergio Chouhy Date: Mon, 26 Jan 2026 13:46:47 -0300 Subject: [PATCH 9/9] use context --- sequencer_core/src/block_settlement_client.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/sequencer_core/src/block_settlement_client.rs b/sequencer_core/src/block_settlement_client.rs index c0c727a8..0aa22420 100644 --- a/sequencer_core/src/block_settlement_client.rs +++ b/sequencer_core/src/block_settlement_client.rs @@ -1,6 +1,6 @@ use std::{fs, path::Path}; -use anyhow::{Result, anyhow}; +use anyhow::{Context, Result, anyhow}; use bedrock_client::BedrockClient; use common::block::HashableBlockData; use logos_blockchain_core::mantle::{ @@ -23,9 +23,11 @@ pub struct BlockSettlementClient { impl BlockSettlementClient { pub fn try_new(home: &Path, config: &BedrockConfig) -> Result { - let bedrock_signing_key = load_or_create_signing_key(&home.join("bedrock_signing_key")).context("Failed to load or create signing key")?; + let bedrock_signing_key = load_or_create_signing_key(&home.join("bedrock_signing_key")) + .context("Failed to load or create signing key")?; let bedrock_channel_id = ChannelId::from(config.channel_id); - let bedrock_client = BedrockClient::new(None, config.node_url.clone()).context("Failed to initialize bedrock client")?; + let bedrock_client = BedrockClient::new(None, config.node_url.clone()) + .context("Failed to initialize bedrock client")?; let channel_genesis_msg = MsgId::from([0; 32]); Ok(Self { bedrock_client,