Merge pull request #526 from logos-blockchain/programs-elfs-deployments-circuits-fix

Bump blockchain deps and update flake
This commit is contained in:
Pravdyvy 2026-06-15 13:43:56 +03:00 committed by GitHub
commit df8a330dcd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
9 changed files with 337 additions and 411 deletions

541
Cargo.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -138,13 +138,13 @@ tokio-retry = "0.3.0"
schemars = "1.2"
async-stream = "0.3.6"
logos-blockchain-common-http-client = { git = "https://github.com/logos-blockchain/logos-blockchain.git", rev = "db9a8d821c1b20f29b03d02072817150cf969b8e" }
logos-blockchain-key-management-system-service = { git = "https://github.com/logos-blockchain/logos-blockchain.git", rev = "db9a8d821c1b20f29b03d02072817150cf969b8e" }
logos-blockchain-core = { git = "https://github.com/logos-blockchain/logos-blockchain.git", rev = "db9a8d821c1b20f29b03d02072817150cf969b8e" }
logos-blockchain-chain-broadcast-service = { git = "https://github.com/logos-blockchain/logos-blockchain.git", rev = "db9a8d821c1b20f29b03d02072817150cf969b8e" }
logos-blockchain-chain-service = { git = "https://github.com/logos-blockchain/logos-blockchain.git", rev = "db9a8d821c1b20f29b03d02072817150cf969b8e" }
logos-blockchain-zone-sdk = { git = "https://github.com/logos-blockchain/logos-blockchain.git", rev = "db9a8d821c1b20f29b03d02072817150cf969b8e" }
logos-blockchain-http-api-common = { git = "https://github.com/logos-blockchain/logos-blockchain.git", rev = "db9a8d821c1b20f29b03d02072817150cf969b8e" }
logos-blockchain-common-http-client = { git = "https://github.com/logos-blockchain/logos-blockchain.git", rev = "d8711bbc3d43d3ef9755ef9b73af32fd0f703160" }
logos-blockchain-key-management-system-service = { git = "https://github.com/logos-blockchain/logos-blockchain.git", rev = "d8711bbc3d43d3ef9755ef9b73af32fd0f703160" }
logos-blockchain-core = { git = "https://github.com/logos-blockchain/logos-blockchain.git", rev = "d8711bbc3d43d3ef9755ef9b73af32fd0f703160" }
logos-blockchain-chain-broadcast-service = { git = "https://github.com/logos-blockchain/logos-blockchain.git", rev = "d8711bbc3d43d3ef9755ef9b73af32fd0f703160" }
logos-blockchain-chain-service = { git = "https://github.com/logos-blockchain/logos-blockchain.git", rev = "d8711bbc3d43d3ef9755ef9b73af32fd0f703160" }
logos-blockchain-zone-sdk = { git = "https://github.com/logos-blockchain/logos-blockchain.git", rev = "d8711bbc3d43d3ef9755ef9b73af32fd0f703160" }
logos-blockchain-http-api-common = { git = "https://github.com/logos-blockchain/logos-blockchain.git", rev = "d8711bbc3d43d3ef9755ef9b73af32fd0f703160" }
rocksdb = { version = "0.24.0", default-features = false, features = [
"snappy",

View File

@ -8,7 +8,6 @@ blend:
scheduler:
cover:
message_frequency_per_round: 1.0
intervals_for_safety_buffer: 100
delayer:
maximum_release_delay_in_rounds: 3
minimum_messages_coefficient: 1
@ -31,10 +30,9 @@ cryptarchia:
sdp_config:
service_params:
BN:
lock_period: 10
inactivity_period: 1
retention_period: 1
timestamp: 0
epoch: 0
min_stake:
threshold: 1
timestamp: 0
@ -72,13 +70,10 @@ cryptarchia:
inscription: '0c000000000000006c6f676f732d6465766e65742c046269000000000000000000000000000000000000000000000000000000000000000000000000'
parent: '0000000000000000000000000000000000000000000000000000000000000000'
signer: '0000000000000000000000000000000000000000000000000000000000000000'
execution_gas_price: 0
storage_gas_price: 0
ops_proofs:
- !Ed25519Sig '00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000'
- !Ed25519Sig '00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000'
time:
slot_duration: '1.0'
chain_start_time: PLACEHOLDER_CHAIN_START_TIME
mempool:
pubsub_topic: mantle_e2e_tests

View File

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

54
flake.lock generated
View File

@ -20,17 +20,17 @@
"nixpkgs": "nixpkgs"
},
"locked": {
"lastModified": 1775835011,
"narHash": "sha256-SQDLyyRUa5J9QHjNiHbeZw4rQOZnTEo61TcaUpjtLBs=",
"lastModified": 1781004244,
"narHash": "sha256-zd4XYY+HPOMJXigHQDmXDvt7D1988YNPUwPPznhpFdA=",
"owner": "logos-blockchain",
"repo": "logos-blockchain-circuits",
"rev": "d6cf41f66500d4afc157b4f43de0f0d5bfa01443",
"rev": "2846ee7a4cfa24458bb8063412ab2e753b344d2f",
"type": "github"
},
"original": {
"owner": "logos-blockchain",
"repo": "logos-blockchain-circuits",
"rev": "d6cf41f66500d4afc157b4f43de0f0d5bfa01443",
"rev": "2846ee7a4cfa24458bb8063412ab2e753b344d2f",
"type": "github"
}
},
@ -6352,16 +6352,16 @@
},
"nixpkgs": {
"locked": {
"lastModified": 1769461804,
"narHash": "sha256-msG8SU5WsBUfVVa/9RPLaymvi5bI8edTavbIq3vRlhI=",
"lastModified": 1767313136,
"narHash": "sha256-16KkgfdYqjaeRGBaYsNrhPRRENs0qzkQVUooNHtoy2w=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "bfc1b8a4574108ceef22f02bafcf6611380c100d",
"rev": "ac62194c3917d5f474c1a844b6fd6da2db95077d",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-unstable",
"ref": "nixos-25.05",
"repo": "nixpkgs",
"type": "github"
}
@ -6942,6 +6942,22 @@
"type": "github"
}
},
"nixpkgs_132": {
"locked": {
"lastModified": 1767313136,
"narHash": "sha256-16KkgfdYqjaeRGBaYsNrhPRRENs0qzkQVUooNHtoy2w=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "ac62194c3917d5f474c1a844b6fd6da2db95077d",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-25.05",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_14": {
"locked": {
"lastModified": 1759036355,
@ -8570,7 +8586,8 @@
"logos-liblogos",
"nixpkgs"
],
"rust-overlay": "rust-overlay"
"rust-overlay": "rust-overlay",
"rust-rapidsnark": "rust-rapidsnark"
}
},
"rust-overlay": {
@ -8592,6 +8609,25 @@
"repo": "rust-overlay",
"type": "github"
}
},
"rust-rapidsnark": {
"inputs": {
"nixpkgs": "nixpkgs_132"
},
"locked": {
"lastModified": 1781090841,
"narHash": "sha256-A1wVkHRw3/xpV30JUgWxvfW5PgcyrxQxk7b4So5vXNs=",
"owner": "logos-blockchain",
"repo": "logos-blockchain-rust-rapidsnark",
"rev": "e91187f8ccb5bbfc7bb00dac88169112428da78f",
"type": "github"
},
"original": {
"owner": "logos-blockchain",
"repo": "logos-blockchain-rust-rapidsnark",
"rev": "e91187f8ccb5bbfc7bb00dac88169112428da78f",
"type": "github"
}
}
},
"root": "root",

View File

@ -13,8 +13,14 @@
crane.url = "github:ipetkov/crane";
# Must stay in sync with the lbc-* tags in logos-blockchain/Cargo.toml.
logos-blockchain-circuits = {
url = "github:logos-blockchain/logos-blockchain-circuits/d6cf41f66500d4afc157b4f43de0f0d5bfa01443";
url = "github:logos-blockchain/logos-blockchain-circuits/2846ee7a4cfa24458bb8063412ab2e753b344d2f";
};
# Must stay in sync with the rust-rapidsnark rev in Cargo.toml.
rust-rapidsnark = {
url = "github:logos-blockchain/logos-blockchain-rust-rapidsnark/e91187f8ccb5bbfc7bb00dac88169112428da78f";
};
};
@ -25,6 +31,7 @@
rust-overlay,
crane,
logos-blockchain-circuits,
rust-rapidsnark,
...
}:
let
@ -103,12 +110,9 @@
pkgs.python3 # Required for correct builds now, as python is sandboxed in nix builds
];
LIBCLANG_PATH = "${pkgs.llvmPackages.libclang.lib}/lib";
LBC_LIB_DIR = "${lbc_dir}";
LOGOS_BLOCKCHAIN_CIRCUITS = "${lbc_dir}";
LBC_POC_LIB_DIR = "${lbc_dir}/poc";
LBC_POL_LIB_DIR = "${lbc_dir}/pol";
LBC_POQ_LIB_DIR = "${lbc_dir}/poq";
LBC_SIGNATURE_LIB_DIR = "${lbc_dir}/zksign";
# Logos blockchain related env vars
LBC_ROOT_DIR = logos-blockchain-circuits.packages.${system}.default;
RAPIDSNARK_LIB_DIR = rust-rapidsnark.packages.${system}.rapidsnark;
# Point the risc0-circuit-recursion build script to the pre-fetched zip
# so it doesn't try to download it inside the sandbox.
RECURSION_SRC_PATH = "${recursionZkr}";

View File

@ -35,6 +35,7 @@ bytesize.workspace = true
hex.workspace = true
url.workspace = true
risc0-zkvm.workspace = true
futures.workspace = true
[features]
default = []

View File

@ -1,21 +1,29 @@
use std::{pin::Pin, sync::Arc, time::Duration};
use anyhow::{Context as _, Result};
use anyhow::{Context as _, Result, anyhow};
use common::block::Block;
use log::warn;
pub use logos_blockchain_core::mantle::ops::channel::MsgId;
use logos_blockchain_core::mantle::ops::channel::inscribe::Inscription;
pub use logos_blockchain_key_management_system_service::keys::Ed25519Key;
pub use logos_blockchain_zone_sdk::sequencer::SequencerCheckpoint;
use logos_blockchain_zone_sdk::{
CommonHttpClient,
adapter::NodeHttpClient,
sequencer::{Event, SequencerConfig as ZoneSdkSequencerConfig, SequencerHandle, ZoneSequencer},
state::{DepositInfo, FinalizedOp, InscriptionInfo},
sequencer::{
DepositInfo, Event, FinalizedOp, InscriptionInfo,
SequencerConfig as ZoneSdkSequencerConfig, ZoneSequencer,
},
};
use tokio::task::JoinHandle;
use tokio::{sync::mpsc, task::JoinHandle};
use crate::config::BedrockConfig;
/// Channel capacity for the publish inbox. One publish per produced block, drained
/// in microseconds by the drive task — 32 is huge headroom and just provides
/// backpressure if the drive task stalls (reconnect, long backfill).
const PUBLISH_INBOX_CAPACITY: usize = 32;
/// Sink for `Event::Published` checkpoints emitted by the drive task.
/// Caller is responsible for persistence (e.g. writing to rocksdb).
pub type CheckpointSink = Box<dyn Fn(SequencerCheckpoint) + Send + 'static>;
@ -47,9 +55,16 @@ pub trait BlockPublisherTrait: Clone {
}
/// Real block publisher backed by zone-sdk's `ZoneSequencer`.
///
/// The sequencer is owned exclusively by the drive task — the new zone-sdk
/// `SequencerHandle` is a `&mut self` borrow, so any out-of-task access
/// requires routing requests through a channel. We send serialized
/// inscriptions over a bounded mpsc; the drive task `tokio::select!`s
/// between `next_event()` and the inbox, calling `sequencer.handle().publish(...)`
/// inline.
#[derive(Clone)]
pub struct ZoneSdkPublisher {
handle: SequencerHandle<NodeHttpClient>,
publish_tx: mpsc::Sender<Inscription>,
// Aborts the drive task when the last clone is dropped.
_drive_task: Arc<DriveTaskGuard>,
}
@ -80,7 +95,7 @@ impl BlockPublisherTrait for ZoneSdkPublisher {
..ZoneSdkSequencerConfig::default()
};
let (mut sequencer, mut handle) = ZoneSequencer::init_with_config(
let mut sequencer = ZoneSequencer::init_with_config(
config.channel_id,
bedrock_signing_key,
node,
@ -88,41 +103,70 @@ impl BlockPublisherTrait for ZoneSdkPublisher {
initial_checkpoint,
);
// Grab readiness receiver before moving the sequencer into the drive
// task so we can await cold-start completion below.
let mut ready_rx = sequencer.subscribe_ready();
let (publish_tx, mut publish_rx) = mpsc::channel::<Inscription>(PUBLISH_INBOX_CAPACITY);
let drive_task = tokio::spawn(async move {
loop {
let Some(event) = sequencer.next_event().await else {
continue;
};
match event {
Event::Checkpoint { checkpoint } => on_checkpoint(checkpoint),
Event::TxsFinalized { items } => {
for op in items.into_iter().flat_map(|item| item.ops) {
match op {
FinalizedOp::Inscription(inscription) => {
if let Some(block_id) = block_id_from_inscription(&inscription)
{
on_finalized_block(block_id);
#[expect(
clippy::integer_division_remainder_used,
reason = "tokio::select! expansion uses `%` for random branch selection"
)]
{
tokio::select! {
// Drain external publish requests by calling the
// borrowing handle — `&mut sequencer` is only
// available here.
Some(data) = publish_rx.recv() => {
if let Err(e) = sequencer.handle().publish(data) {
warn!("zone-sdk publish failed: {e:?}");
}
}
event = sequencer.next_event() => {
let Some(event) = event else { continue };
match event {
Event::BlocksProcessed {
checkpoint,
channel_update: _,
finalized,
} => {
on_checkpoint(checkpoint);
for op in finalized.into_iter().flat_map(|item| item.ops) {
match op {
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(_) => {}
}
}
}
FinalizedOp::Deposit(deposit) => {
on_deposit_event(deposit).await;
}
FinalizedOp::Withdraw(_) => {}
Event::Ready | Event::TurnNotification { .. } => {}
}
}
}
Event::ChannelUpdate { .. }
| Event::Published { .. }
| Event::Readiness { .. }
| Event::TurnNotification { .. } => {}
}
}
});
handle.wait_ready().await;
// Wait for cold-start backfill to complete before returning so callers
// can publish immediately (e.g. genesis block) without racing readiness.
ready_rx
.wait_for(|v| *v)
.await
.context("Zone-sdk readiness channel closed before becoming ready")?;
Ok(Self {
handle,
publish_tx,
_drive_task: Arc::new(DriveTaskGuard(drive_task)),
})
}
@ -133,10 +177,10 @@ impl BlockPublisherTrait for ZoneSdkPublisher {
.try_into()
.context("Block data exceeds maximum allowed size")?;
self.handle
.publish_message(data_bounded)
self.publish_tx
.send(data_bounded)
.await
.context("Failed to publish block")?;
.map_err(|_closed| anyhow!("Drive task is no longer running"))?;
Ok(())
}

View File

@ -12,6 +12,7 @@ use lee::{AccountId, PublicTransaction, program::Program, public_transaction::Me
use lee_core::GENESIS_BLOCK_ID;
use log::{error, info, warn};
use logos_blockchain_key_management_system_service::keys::{ED25519_SECRET_KEY_SIZE, Ed25519Key};
use logos_blockchain_zone_sdk::sequencer::DepositInfo;
use mempool::{MemPool, MemPoolHandle};
#[cfg(feature = "mock")]
pub use mock::SequencerCoreWithMockClients;
@ -611,9 +612,7 @@ fn build_supply_bridge_account_genesis_transaction(balance: u128) -> PublicTrans
PublicTransaction::new(message, witness_set)
}
fn pending_deposit_event_record(
deposit: &logos_blockchain_zone_sdk::state::DepositInfo,
) -> PendingDepositEventRecord {
fn pending_deposit_event_record(deposit: &DepositInfo) -> PendingDepositEventRecord {
PendingDepositEventRecord {
deposit_op_id: HashType(deposit.op_id),
source_tx_hash: HashType(deposit.tx_hash.0),