refactor(cross-zone): use the Balance alias for holding amounts and debug-log skipped replays

This commit is contained in:
moudyellaz 2026-07-16 12:44:36 +02:00
parent 0f88fda054
commit 9380198eb9
3 changed files with 10 additions and 4 deletions

View File

@ -18,7 +18,7 @@ use cross_zone_inbox_core::{
};
use lee::program::Program;
use lee_core::{
account::{Account, AccountId},
account::{Account, AccountId, Balance},
program::ProgramId,
};
use serde::{Deserialize, Serialize};
@ -225,7 +225,7 @@ pub fn build_inbox_config_account(
/// transaction, so the sequencer and indexer both seed it through this one
/// builder.
#[must_use]
pub fn build_holding_account(holder: AccountId, amount: u128) -> (AccountId, Account) {
pub fn build_holding_account(holder: AccountId, amount: Balance) -> (AccountId, Account) {
let account = Account {
program_owner: programs::bridge_lock().id(),
data: bridge_lock_core::balance_bytes(amount)

View File

@ -12,7 +12,7 @@ use cross_zone_inbox_core::{
};
use futures::StreamExt as _;
use lee::PublicKey;
use log::{error, info};
use log::{debug, error, info};
use logos_blockchain_core::mantle::ops::channel::ChannelId;
use logos_blockchain_zone_sdk::{
CommonHttpClient, ZoneMessage, adapter::NodeHttpClient, indexer::ZoneIndexer,
@ -133,6 +133,12 @@ impl CrossZoneVerifier {
let key = message_key(&msg.src_zone, msg.src_block_id, msg.src_tx_index);
if self.seen.read().await.contains(&key) {
debug!(
"Skipping already-seen cross-zone dispatch from zone {} block {} tx {} (replay no-op)",
hex::encode(msg.src_zone),
msg.src_block_id,
msg.src_tx_index
);
continue;
}

View File

@ -689,7 +689,7 @@ fn build_genesis_state(config: &SequencerConfig) -> (lee::V03State, Vec<LeeTrans
}
/// Bridge-lock holder balances configured for this zone's genesis.
fn bridge_lock_holdings(genesis: &[GenesisAction]) -> Vec<(lee::AccountId, u128)> {
fn bridge_lock_holdings(genesis: &[GenesisAction]) -> Vec<(lee::AccountId, lee::Balance)> {
genesis
.iter()
.filter_map(|action| match action {