mirror of
https://github.com/logos-blockchain/logos-execution-zone.git
synced 2026-07-30 09:33:28 +00:00
Merge pull request #526 from logos-blockchain/programs-elfs-deployments-circuits-fix
Bump blockchain deps and update flake
This commit is contained in:
commit
df8a330dcd
541
Cargo.lock
generated
541
Cargo.lock
generated
File diff suppressed because it is too large
Load Diff
14
Cargo.toml
14
Cargo.toml
@ -138,13 +138,13 @@ tokio-retry = "0.3.0"
|
|||||||
schemars = "1.2"
|
schemars = "1.2"
|
||||||
async-stream = "0.3.6"
|
async-stream = "0.3.6"
|
||||||
|
|
||||||
logos-blockchain-common-http-client = { 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 = "db9a8d821c1b20f29b03d02072817150cf969b8e" }
|
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 = "db9a8d821c1b20f29b03d02072817150cf969b8e" }
|
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 = "db9a8d821c1b20f29b03d02072817150cf969b8e" }
|
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 = "db9a8d821c1b20f29b03d02072817150cf969b8e" }
|
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 = "db9a8d821c1b20f29b03d02072817150cf969b8e" }
|
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 = "db9a8d821c1b20f29b03d02072817150cf969b8e" }
|
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 = [
|
rocksdb = { version = "0.24.0", default-features = false, features = [
|
||||||
"snappy",
|
"snappy",
|
||||||
|
|||||||
@ -8,7 +8,6 @@ blend:
|
|||||||
scheduler:
|
scheduler:
|
||||||
cover:
|
cover:
|
||||||
message_frequency_per_round: 1.0
|
message_frequency_per_round: 1.0
|
||||||
intervals_for_safety_buffer: 100
|
|
||||||
delayer:
|
delayer:
|
||||||
maximum_release_delay_in_rounds: 3
|
maximum_release_delay_in_rounds: 3
|
||||||
minimum_messages_coefficient: 1
|
minimum_messages_coefficient: 1
|
||||||
@ -31,10 +30,9 @@ cryptarchia:
|
|||||||
sdp_config:
|
sdp_config:
|
||||||
service_params:
|
service_params:
|
||||||
BN:
|
BN:
|
||||||
lock_period: 10
|
|
||||||
inactivity_period: 1
|
inactivity_period: 1
|
||||||
retention_period: 1
|
retention_period: 1
|
||||||
timestamp: 0
|
epoch: 0
|
||||||
min_stake:
|
min_stake:
|
||||||
threshold: 1
|
threshold: 1
|
||||||
timestamp: 0
|
timestamp: 0
|
||||||
@ -72,13 +70,10 @@ cryptarchia:
|
|||||||
inscription: '0c000000000000006c6f676f732d6465766e65742c046269000000000000000000000000000000000000000000000000000000000000000000000000'
|
inscription: '0c000000000000006c6f676f732d6465766e65742c046269000000000000000000000000000000000000000000000000000000000000000000000000'
|
||||||
parent: '0000000000000000000000000000000000000000000000000000000000000000'
|
parent: '0000000000000000000000000000000000000000000000000000000000000000'
|
||||||
signer: '0000000000000000000000000000000000000000000000000000000000000000'
|
signer: '0000000000000000000000000000000000000000000000000000000000000000'
|
||||||
execution_gas_price: 0
|
|
||||||
storage_gas_price: 0
|
|
||||||
ops_proofs:
|
ops_proofs:
|
||||||
- !Ed25519Sig '00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000'
|
- !Ed25519Sig '00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000'
|
||||||
- !Ed25519Sig '00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000'
|
- !Ed25519Sig '00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000'
|
||||||
time:
|
time:
|
||||||
slot_duration: '1.0'
|
slot_duration: '1.0'
|
||||||
chain_start_time: PLACEHOLDER_CHAIN_START_TIME
|
|
||||||
mempool:
|
mempool:
|
||||||
pubsub_topic: mantle_e2e_tests
|
pubsub_topic: mantle_e2e_tests
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
services:
|
services:
|
||||||
|
|
||||||
logos-blockchain-node-0:
|
logos-blockchain-node-0:
|
||||||
image: ghcr.io/logos-blockchain/logos-blockchain@sha256:f160cfbf898a06554451cc066d84cfd0f8ab62d59bd3e62d9cde3bd5582c12ab
|
image: ghcr.io/logos-blockchain/logos-blockchain@sha256:91d6c5bf07e07fcfba5e7cf07d21ee686a6bc4b9f6210f2d28bffbcad9a3729f
|
||||||
ports:
|
ports:
|
||||||
- "${PORT:-8080}:18080/tcp"
|
- "${PORT:-8080}:18080/tcp"
|
||||||
volumes:
|
volumes:
|
||||||
|
|||||||
54
flake.lock
generated
54
flake.lock
generated
@ -20,17 +20,17 @@
|
|||||||
"nixpkgs": "nixpkgs"
|
"nixpkgs": "nixpkgs"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1775835011,
|
"lastModified": 1781004244,
|
||||||
"narHash": "sha256-SQDLyyRUa5J9QHjNiHbeZw4rQOZnTEo61TcaUpjtLBs=",
|
"narHash": "sha256-zd4XYY+HPOMJXigHQDmXDvt7D1988YNPUwPPznhpFdA=",
|
||||||
"owner": "logos-blockchain",
|
"owner": "logos-blockchain",
|
||||||
"repo": "logos-blockchain-circuits",
|
"repo": "logos-blockchain-circuits",
|
||||||
"rev": "d6cf41f66500d4afc157b4f43de0f0d5bfa01443",
|
"rev": "2846ee7a4cfa24458bb8063412ab2e753b344d2f",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"owner": "logos-blockchain",
|
"owner": "logos-blockchain",
|
||||||
"repo": "logos-blockchain-circuits",
|
"repo": "logos-blockchain-circuits",
|
||||||
"rev": "d6cf41f66500d4afc157b4f43de0f0d5bfa01443",
|
"rev": "2846ee7a4cfa24458bb8063412ab2e753b344d2f",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -6352,16 +6352,16 @@
|
|||||||
},
|
},
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1769461804,
|
"lastModified": 1767313136,
|
||||||
"narHash": "sha256-msG8SU5WsBUfVVa/9RPLaymvi5bI8edTavbIq3vRlhI=",
|
"narHash": "sha256-16KkgfdYqjaeRGBaYsNrhPRRENs0qzkQVUooNHtoy2w=",
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "bfc1b8a4574108ceef22f02bafcf6611380c100d",
|
"rev": "ac62194c3917d5f474c1a844b6fd6da2db95077d",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"ref": "nixos-unstable",
|
"ref": "nixos-25.05",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
@ -6942,6 +6942,22 @@
|
|||||||
"type": "github"
|
"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": {
|
"nixpkgs_14": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1759036355,
|
"lastModified": 1759036355,
|
||||||
@ -8570,7 +8586,8 @@
|
|||||||
"logos-liblogos",
|
"logos-liblogos",
|
||||||
"nixpkgs"
|
"nixpkgs"
|
||||||
],
|
],
|
||||||
"rust-overlay": "rust-overlay"
|
"rust-overlay": "rust-overlay",
|
||||||
|
"rust-rapidsnark": "rust-rapidsnark"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"rust-overlay": {
|
"rust-overlay": {
|
||||||
@ -8592,6 +8609,25 @@
|
|||||||
"repo": "rust-overlay",
|
"repo": "rust-overlay",
|
||||||
"type": "github"
|
"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",
|
"root": "root",
|
||||||
|
|||||||
18
flake.nix
18
flake.nix
@ -13,8 +13,14 @@
|
|||||||
|
|
||||||
crane.url = "github:ipetkov/crane";
|
crane.url = "github:ipetkov/crane";
|
||||||
|
|
||||||
|
# Must stay in sync with the lbc-* tags in logos-blockchain/Cargo.toml.
|
||||||
logos-blockchain-circuits = {
|
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,
|
rust-overlay,
|
||||||
crane,
|
crane,
|
||||||
logos-blockchain-circuits,
|
logos-blockchain-circuits,
|
||||||
|
rust-rapidsnark,
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
let
|
let
|
||||||
@ -103,12 +110,9 @@
|
|||||||
pkgs.python3 # Required for correct builds now, as python is sandboxed in nix builds
|
pkgs.python3 # Required for correct builds now, as python is sandboxed in nix builds
|
||||||
];
|
];
|
||||||
LIBCLANG_PATH = "${pkgs.llvmPackages.libclang.lib}/lib";
|
LIBCLANG_PATH = "${pkgs.llvmPackages.libclang.lib}/lib";
|
||||||
LBC_LIB_DIR = "${lbc_dir}";
|
# Logos blockchain related env vars
|
||||||
LOGOS_BLOCKCHAIN_CIRCUITS = "${lbc_dir}";
|
LBC_ROOT_DIR = logos-blockchain-circuits.packages.${system}.default;
|
||||||
LBC_POC_LIB_DIR = "${lbc_dir}/poc";
|
RAPIDSNARK_LIB_DIR = rust-rapidsnark.packages.${system}.rapidsnark;
|
||||||
LBC_POL_LIB_DIR = "${lbc_dir}/pol";
|
|
||||||
LBC_POQ_LIB_DIR = "${lbc_dir}/poq";
|
|
||||||
LBC_SIGNATURE_LIB_DIR = "${lbc_dir}/zksign";
|
|
||||||
# Point the risc0-circuit-recursion build script to the pre-fetched zip
|
# Point the risc0-circuit-recursion build script to the pre-fetched zip
|
||||||
# so it doesn't try to download it inside the sandbox.
|
# so it doesn't try to download it inside the sandbox.
|
||||||
RECURSION_SRC_PATH = "${recursionZkr}";
|
RECURSION_SRC_PATH = "${recursionZkr}";
|
||||||
|
|||||||
@ -35,6 +35,7 @@ bytesize.workspace = true
|
|||||||
hex.workspace = true
|
hex.workspace = true
|
||||||
url.workspace = true
|
url.workspace = true
|
||||||
risc0-zkvm.workspace = true
|
risc0-zkvm.workspace = true
|
||||||
|
futures.workspace = true
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
default = []
|
default = []
|
||||||
|
|||||||
@ -1,21 +1,29 @@
|
|||||||
use std::{pin::Pin, sync::Arc, time::Duration};
|
use std::{pin::Pin, sync::Arc, time::Duration};
|
||||||
|
|
||||||
use anyhow::{Context as _, Result};
|
use anyhow::{Context as _, Result, anyhow};
|
||||||
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;
|
||||||
|
use logos_blockchain_core::mantle::ops::channel::inscribe::Inscription;
|
||||||
pub use logos_blockchain_key_management_system_service::keys::Ed25519Key;
|
pub use logos_blockchain_key_management_system_service::keys::Ed25519Key;
|
||||||
pub use logos_blockchain_zone_sdk::sequencer::SequencerCheckpoint;
|
pub use logos_blockchain_zone_sdk::sequencer::SequencerCheckpoint;
|
||||||
use logos_blockchain_zone_sdk::{
|
use logos_blockchain_zone_sdk::{
|
||||||
CommonHttpClient,
|
CommonHttpClient,
|
||||||
adapter::NodeHttpClient,
|
adapter::NodeHttpClient,
|
||||||
sequencer::{Event, SequencerConfig as ZoneSdkSequencerConfig, SequencerHandle, ZoneSequencer},
|
sequencer::{
|
||||||
state::{DepositInfo, FinalizedOp, InscriptionInfo},
|
DepositInfo, Event, FinalizedOp, InscriptionInfo,
|
||||||
|
SequencerConfig as ZoneSdkSequencerConfig, ZoneSequencer,
|
||||||
|
},
|
||||||
};
|
};
|
||||||
use tokio::task::JoinHandle;
|
use tokio::{sync::mpsc, task::JoinHandle};
|
||||||
|
|
||||||
use crate::config::BedrockConfig;
|
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.
|
/// 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 + 'static>;
|
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`.
|
/// 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)]
|
#[derive(Clone)]
|
||||||
pub struct ZoneSdkPublisher {
|
pub struct ZoneSdkPublisher {
|
||||||
handle: SequencerHandle<NodeHttpClient>,
|
publish_tx: mpsc::Sender<Inscription>,
|
||||||
// Aborts the drive task when the last clone is dropped.
|
// Aborts the drive task when the last clone is dropped.
|
||||||
_drive_task: Arc<DriveTaskGuard>,
|
_drive_task: Arc<DriveTaskGuard>,
|
||||||
}
|
}
|
||||||
@ -80,7 +95,7 @@ impl BlockPublisherTrait for ZoneSdkPublisher {
|
|||||||
..ZoneSdkSequencerConfig::default()
|
..ZoneSdkSequencerConfig::default()
|
||||||
};
|
};
|
||||||
|
|
||||||
let (mut sequencer, mut handle) = ZoneSequencer::init_with_config(
|
let mut sequencer = ZoneSequencer::init_with_config(
|
||||||
config.channel_id,
|
config.channel_id,
|
||||||
bedrock_signing_key,
|
bedrock_signing_key,
|
||||||
node,
|
node,
|
||||||
@ -88,41 +103,70 @@ impl BlockPublisherTrait for ZoneSdkPublisher {
|
|||||||
initial_checkpoint,
|
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 {
|
let drive_task = tokio::spawn(async move {
|
||||||
loop {
|
loop {
|
||||||
let Some(event) = sequencer.next_event().await else {
|
#[expect(
|
||||||
continue;
|
clippy::integer_division_remainder_used,
|
||||||
};
|
reason = "tokio::select! expansion uses `%` for random branch selection"
|
||||||
match event {
|
)]
|
||||||
Event::Checkpoint { checkpoint } => on_checkpoint(checkpoint),
|
{
|
||||||
Event::TxsFinalized { items } => {
|
tokio::select! {
|
||||||
for op in items.into_iter().flat_map(|item| item.ops) {
|
// Drain external publish requests by calling the
|
||||||
match op {
|
// borrowing handle — `&mut sequencer` is only
|
||||||
FinalizedOp::Inscription(inscription) => {
|
// available here.
|
||||||
if let Some(block_id) = block_id_from_inscription(&inscription)
|
Some(data) = publish_rx.recv() => {
|
||||||
{
|
if let Err(e) = sequencer.handle().publish(data) {
|
||||||
on_finalized_block(block_id);
|
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) => {
|
Event::Ready | Event::TurnNotification { .. } => {}
|
||||||
on_deposit_event(deposit).await;
|
|
||||||
}
|
|
||||||
FinalizedOp::Withdraw(_) => {}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
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 {
|
Ok(Self {
|
||||||
handle,
|
publish_tx,
|
||||||
_drive_task: Arc::new(DriveTaskGuard(drive_task)),
|
_drive_task: Arc::new(DriveTaskGuard(drive_task)),
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@ -133,10 +177,10 @@ impl BlockPublisherTrait for ZoneSdkPublisher {
|
|||||||
.try_into()
|
.try_into()
|
||||||
.context("Block data exceeds maximum allowed size")?;
|
.context("Block data exceeds maximum allowed size")?;
|
||||||
|
|
||||||
self.handle
|
self.publish_tx
|
||||||
.publish_message(data_bounded)
|
.send(data_bounded)
|
||||||
.await
|
.await
|
||||||
.context("Failed to publish block")?;
|
.map_err(|_closed| anyhow!("Drive task is no longer running"))?;
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|||||||
@ -12,6 +12,7 @@ use lee::{AccountId, PublicTransaction, program::Program, public_transaction::Me
|
|||||||
use lee_core::GENESIS_BLOCK_ID;
|
use lee_core::GENESIS_BLOCK_ID;
|
||||||
use log::{error, info, warn};
|
use log::{error, info, warn};
|
||||||
use logos_blockchain_key_management_system_service::keys::{ED25519_SECRET_KEY_SIZE, Ed25519Key};
|
use logos_blockchain_key_management_system_service::keys::{ED25519_SECRET_KEY_SIZE, Ed25519Key};
|
||||||
|
use logos_blockchain_zone_sdk::sequencer::DepositInfo;
|
||||||
use mempool::{MemPool, MemPoolHandle};
|
use mempool::{MemPool, MemPoolHandle};
|
||||||
#[cfg(feature = "mock")]
|
#[cfg(feature = "mock")]
|
||||||
pub use mock::SequencerCoreWithMockClients;
|
pub use mock::SequencerCoreWithMockClients;
|
||||||
@ -611,9 +612,7 @@ fn build_supply_bridge_account_genesis_transaction(balance: u128) -> PublicTrans
|
|||||||
PublicTransaction::new(message, witness_set)
|
PublicTransaction::new(message, witness_set)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn pending_deposit_event_record(
|
fn pending_deposit_event_record(deposit: &DepositInfo) -> PendingDepositEventRecord {
|
||||||
deposit: &logos_blockchain_zone_sdk::state::DepositInfo,
|
|
||||||
) -> PendingDepositEventRecord {
|
|
||||||
PendingDepositEventRecord {
|
PendingDepositEventRecord {
|
||||||
deposit_op_id: HashType(deposit.op_id),
|
deposit_op_id: HashType(deposit.op_id),
|
||||||
source_tx_hash: HashType(deposit.tx_hash.0),
|
source_tx_hash: HashType(deposit.tx_hash.0),
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user