mirror of
https://github.com/logos-blockchain/lssa.git
synced 2026-07-17 05:09:54 +00:00
refactor(cross-zone): use the Balance alias for holding amounts and debug-log skipped replays
This commit is contained in:
parent
0f88fda054
commit
9380198eb9
@ -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)
|
||||
|
||||
@ -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;
|
||||
}
|
||||
|
||||
|
||||
@ -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 {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user