From a806ebb94af0c75790881b82dbd44088f921152f Mon Sep 17 00:00:00 2001 From: moudyellaz Date: Tue, 21 Jul 2026 10:50:41 +0200 Subject: [PATCH] refactor(cross-zone)!: register cross-zone programs as base builtins BREAKING CHANGE: GenesisAction::DeployProgram and IndexerConfig.deploy_programs are removed. The cross-zone programs (inbox, outbox, ping_sender, ping_receiver, bridge_lock, wrapped_token) are now base builtins in testnet_initial_state, because program bytecode exceeds the genesis block inscription limit, so they cannot be shipped through genesis transactions. --- integration_tests/tests/cross_zone_bridge.rs | 27 ++----- .../tests/cross_zone_ingress_guard.rs | 12 +-- integration_tests/tests/cross_zone_ping.rs | 25 ++---- .../tests/cross_zone_verified.rs | 36 +++------ .../tests/indexer_ffi_helpers/mod.rs | 1 - integration_tests/tests/two_zone.rs | 4 +- lee/state_machine/src/state/mod.rs | 12 +-- lez/cross_zone/src/lib.rs | 50 ------------ lez/indexer/core/src/block_store.rs | 3 + lez/indexer/core/src/chain_consistency.rs | 1 - lez/indexer/core/src/config.rs | 7 -- lez/indexer/core/src/lib.rs | 5 +- lez/sequencer/core/src/config.rs | 8 -- lez/sequencer/core/src/lib.rs | 30 ++------ lez/testnet_initial_state/src/lib.rs | 10 +++ test_fixtures/src/config.rs | 77 +------------------ test_fixtures/src/lib.rs | 2 +- test_fixtures/src/setup.rs | 6 +- tools/cross_zone_chat/src/main.rs | 4 +- 19 files changed, 62 insertions(+), 258 deletions(-) diff --git a/integration_tests/tests/cross_zone_bridge.rs b/integration_tests/tests/cross_zone_bridge.rs index f0eedd69..83eefc00 100644 --- a/integration_tests/tests/cross_zone_bridge.rs +++ b/integration_tests/tests/cross_zone_bridge.rs @@ -65,31 +65,20 @@ async fn lock_on_zone_a_mints_wrapped_token_on_zone_b() -> Result<()> { // Zone A seeds the holder's bridgeable balance. Zone B runs the watcher on its // sequencer and the verifier on its indexer. - let mut genesis_a = vec![GenesisAction::SupplyBridgeLockHolding { + let genesis_a = vec![GenesisAction::SupplyBridgeLockHolding { holder: holder_id, amount: INITIAL_BALANCE, }]; - genesis_a.extend(config::cross_zone_deploy_actions()); let (seq_a, _seq_a_home) = setup_sequencer(partial, bedrock_addr, genesis_a, channel_a, None) .await .context("Failed to set up zone A sequencer")?; - let (_seq_b, _seq_b_home) = setup_sequencer( - partial, - bedrock_addr, - config::cross_zone_deploy_actions(), - channel_b, - Some(cross_zone.clone()), - ) - .await - .context("Failed to set up zone B sequencer")?; - let (idx_b, _idx_b_home) = setup_indexer( - bedrock_addr, - channel_b, - Some(cross_zone), - config::all_cross_zone_programs(), - ) - .await - .context("Failed to set up zone B indexer")?; + let (_seq_b, _seq_b_home) = + setup_sequencer(partial, bedrock_addr, vec![], channel_b, Some(cross_zone.clone())) + .await + .context("Failed to set up zone B sequencer")?; + let (idx_b, _idx_b_home) = setup_indexer(bedrock_addr, channel_b, Some(cross_zone)) + .await + .context("Failed to set up zone B indexer")?; // Lock LOCK_AMOUNT on zone A, addressed to the recipient on zone B. let lock = build_lock_tx(&holder_key, holder_id, zone_b); diff --git a/integration_tests/tests/cross_zone_ingress_guard.rs b/integration_tests/tests/cross_zone_ingress_guard.rs index 8a2e0f1b..5f401869 100644 --- a/integration_tests/tests/cross_zone_ingress_guard.rs +++ b/integration_tests/tests/cross_zone_ingress_guard.rs @@ -34,15 +34,9 @@ async fn user_origin_inbox_call_rejected() -> Result<()> { .context("Failed to set up Bedrock node")?; let partial = SequencerPartialConfig::default(); let channel = config::bedrock_channel_id(); - let (seq, _seq_home) = setup_sequencer( - partial, - bedrock_addr, - config::cross_zone_deploy_actions(), - channel, - None, - ) - .await - .context("Failed to set up sequencer")?; + let (seq, _seq_home) = setup_sequencer(partial, bedrock_addr, vec![], channel, None) + .await + .context("Failed to set up sequencer")?; // A user hand-builds a top-level inbox Dispatch and submits it via RPC. let inbox_id = programs::cross_zone_inbox().id(); diff --git a/integration_tests/tests/cross_zone_ping.rs b/integration_tests/tests/cross_zone_ping.rs index 92628c5c..19223b5f 100644 --- a/integration_tests/tests/cross_zone_ping.rs +++ b/integration_tests/tests/cross_zone_ping.rs @@ -54,24 +54,13 @@ async fn ping_crosses_from_zone_a_to_zone_b() -> Result<()> { }], }; - let (seq_a, _seq_a_home) = setup_sequencer( - partial, - bedrock_addr, - config::cross_zone_deploy_actions(), - channel_a, - None, - ) - .await - .context("Failed to set up zone A sequencer")?; - let (seq_b, _seq_b_home) = setup_sequencer( - partial, - bedrock_addr, - config::cross_zone_deploy_actions(), - channel_b, - Some(cross_zone), - ) - .await - .context("Failed to set up zone B sequencer")?; + let (seq_a, _seq_a_home) = setup_sequencer(partial, bedrock_addr, vec![], channel_a, None) + .await + .context("Failed to set up zone A sequencer")?; + let (seq_b, _seq_b_home) = + setup_sequencer(partial, bedrock_addr, vec![], channel_b, Some(cross_zone)) + .await + .context("Failed to set up zone B sequencer")?; // Submit the ping on zone A, addressed to ping_receiver on zone B. let ping = build_ping_tx(zone_b, receiver_id); diff --git a/integration_tests/tests/cross_zone_verified.rs b/integration_tests/tests/cross_zone_verified.rs index 7bcd0998..e2f016c0 100644 --- a/integration_tests/tests/cross_zone_verified.rs +++ b/integration_tests/tests/cross_zone_verified.rs @@ -53,40 +53,24 @@ async fn indexer_verifies_and_delivers_cross_zone_ping() -> Result<()> { // Zone A: source. Zone B: destination, with the watcher on its sequencer and // the verifier on its indexer. - let (seq_a, _seq_a_home) = setup_sequencer( - partial, - bedrock_addr, - config::cross_zone_deploy_actions(), - channel_a, - None, - ) - .await - .context("Failed to set up zone A sequencer")?; - let (_idx_a, _idx_a_home) = setup_indexer( - bedrock_addr, - channel_a, - None, - config::all_cross_zone_programs(), - ) - .await - .context("Failed to set up zone A indexer")?; + let (seq_a, _seq_a_home) = setup_sequencer(partial, bedrock_addr, vec![], channel_a, None) + .await + .context("Failed to set up zone A sequencer")?; + let (_idx_a, _idx_a_home) = setup_indexer(bedrock_addr, channel_a, None) + .await + .context("Failed to set up zone A indexer")?; let (_seq_b, _seq_b_home) = setup_sequencer( partial, bedrock_addr, - config::cross_zone_deploy_actions(), + vec![], channel_b, Some(cross_zone.clone()), ) .await .context("Failed to set up zone B sequencer")?; - let (idx_b, _idx_b_home) = setup_indexer( - bedrock_addr, - channel_b, - Some(cross_zone), - config::all_cross_zone_programs(), - ) - .await - .context("Failed to set up zone B indexer")?; + let (idx_b, _idx_b_home) = setup_indexer(bedrock_addr, channel_b, Some(cross_zone)) + .await + .context("Failed to set up zone B indexer")?; // Submit the ping on zone A, addressed to ping_receiver on zone B. let ping = build_ping_tx(zone_b, receiver_id); diff --git a/integration_tests/tests/indexer_ffi_helpers/mod.rs b/integration_tests/tests/indexer_ffi_helpers/mod.rs index c1065968..09e0a927 100644 --- a/integration_tests/tests/indexer_ffi_helpers/mod.rs +++ b/integration_tests/tests/indexer_ffi_helpers/mod.rs @@ -54,7 +54,6 @@ pub fn setup_indexer_ffi(bedrock_addr: SocketAddr) -> Result<(IndexerServiceFFI, bedrock_addr, integration_tests::config::bedrock_channel_id(), None, - Vec::new(), ) .context("Failed to create Indexer config")?; diff --git a/integration_tests/tests/two_zone.rs b/integration_tests/tests/two_zone.rs index f1bdd8c7..c895acd1 100644 --- a/integration_tests/tests/two_zone.rs +++ b/integration_tests/tests/two_zone.rs @@ -38,13 +38,13 @@ async fn two_zones_share_one_bedrock_and_both_advance() -> Result<()> { let (seq_a, _seq_a_home) = setup_sequencer(partial, bedrock_addr, vec![], channel_a, None) .await .context("Failed to set up zone A sequencer")?; - let (idx_a, _idx_a_home) = setup_indexer(bedrock_addr, channel_a, None, Vec::new()) + let (idx_a, _idx_a_home) = setup_indexer(bedrock_addr, channel_a, None) .await .context("Failed to set up zone A indexer")?; let (seq_b, _seq_b_home) = setup_sequencer(partial, bedrock_addr, vec![], channel_b, None) .await .context("Failed to set up zone B sequencer")?; - let (idx_b, _idx_b_home) = setup_indexer(bedrock_addr, channel_b, None, Vec::new()) + let (idx_b, _idx_b_home) = setup_indexer(bedrock_addr, channel_b, None) .await .context("Failed to set up zone B indexer")?; diff --git a/lee/state_machine/src/state/mod.rs b/lee/state_machine/src/state/mod.rs index f21530e0..d9f7299e 100644 --- a/lee/state_machine/src/state/mod.rs +++ b/lee/state_machine/src/state/mod.rs @@ -287,12 +287,12 @@ impl V03State { /// Order-independent fingerprint of the genesis-relevant state: the public /// account set, the deployed program set, and the commitment-set digest. /// - /// The sequencer and the indexer build genesis separately from their own - /// configs (the cross-zone deploy set is seeded directly, not carried by a - /// genesis transaction), so a mismatched `DeployProgram` / `deploy_programs` - /// list would otherwise diverge silently. Both nodes log this at startup; - /// equal values mean the two genesis states agree. Entries are sorted by id - /// before hashing, so the value does not depend on `HashMap` iteration order. + /// The sequencer and the indexer build the directly-seeded part of genesis + /// (base builtins plus any directly-seeded accounts) separately from their own + /// configs, so a divergence there would otherwise go unnoticed. Both nodes log + /// this at startup; equal values mean the two genesis states agree. Entries are + /// sorted by id before hashing, so the value does not depend on `HashMap` + /// iteration order. #[must_use] pub fn genesis_fingerprint(&self) -> [u8; 32] { use sha2::{Digest as _, Sha256}; diff --git a/lez/cross_zone/src/lib.rs b/lez/cross_zone/src/lib.rs index 983622bd..a10b3b0f 100644 --- a/lez/cross_zone/src/lib.rs +++ b/lez/cross_zone/src/lib.rs @@ -16,12 +16,10 @@ use cross_zone_inbox_core::{ CrossZoneMessage, InboxConfig, Instruction, ZoneId, inbox_config_account_id, inbox_seen_shard_account_id, }; -use lee::program::Program; use lee_core::{ account::{Account, AccountId, Balance}, program::ProgramId, }; -use serde::{Deserialize, Serialize}; /// The cross-zone emission fields a watcher or verifier reads off a source /// transaction, common to every emitter program. @@ -32,47 +30,6 @@ pub struct Emission { pub payload: Vec, } -/// A cross-zone builtin a zone deploys at genesis via `DeployProgram`. -/// -/// Keeps the cross-zone programs out of the production builtin set. A zone lists -/// the ones it uses (a sender needs the outbox and its emitter, a receiver the -/// inbox and its targets); [`CrossZoneProgram::ALL`] deploys the whole set. -#[derive(Clone, Copy, Debug, PartialEq, Eq, Serialize, Deserialize)] -#[serde(rename_all = "snake_case")] -pub enum CrossZoneProgram { - Outbox, - Inbox, - PingSender, - PingReceiver, - BridgeLock, - WrappedToken, -} - -impl CrossZoneProgram { - /// Every cross-zone builtin, for a zone that participates in all flows. - pub const ALL: [Self; 6] = [ - Self::Outbox, - Self::Inbox, - Self::PingSender, - Self::PingReceiver, - Self::BridgeLock, - Self::WrappedToken, - ]; - - /// Resolves to the builtin program to register in genesis state. - #[must_use] - pub const fn program(self) -> Program { - match self { - Self::Outbox => programs::cross_zone_outbox(), - Self::Inbox => programs::cross_zone_inbox(), - Self::PingSender => programs::ping_sender(), - Self::PingReceiver => programs::ping_receiver(), - Self::BridgeLock => programs::bridge_lock(), - Self::WrappedToken => programs::wrapped_token(), - } - } -} - /// Whether a program may only be invoked by sequencer-origin transactions. /// /// The cross-zone inbox is injected solely by the watcher; a user-submitted call @@ -237,13 +194,6 @@ pub fn build_holding_account(holder: AccountId, amount: Balance) -> (AccountId, (holder, account) } -/// Resolves a list of [`CrossZoneProgram`] selectors to the builtin programs to -/// register in genesis state. -#[must_use] -pub fn deployed_programs(programs: &[CrossZoneProgram]) -> Vec { - programs.iter().map(|p| p.program()).collect() -} - /// The wrapped-token config account, pinning the cross-zone inbox as the /// authorized minter without importing the inbox id into the guest. Fixed for /// every zone, part of the cross-zone genesis setup. diff --git a/lez/indexer/core/src/block_store.rs b/lez/indexer/core/src/block_store.rs index 4748a219..cf1a77e6 100644 --- a/lez/indexer/core/src/block_store.rs +++ b/lez/indexer/core/src/block_store.rs @@ -364,6 +364,9 @@ fn apply_block_to_scratch(block: &Block, state: &mut V03State) -> Result<(), Blo reason: format!("{err:#}"), }; if is_genesis { + // Every genesis transaction is public (program config, supplies, clock); + // a non-public one is unexpected and parks the indexer rather than + // silently diverging. let LeeTransaction::Public(public_tx) = transaction else { return Err(BlockIngestError::NonPublicGenesisTransaction); }; diff --git a/lez/indexer/core/src/chain_consistency.rs b/lez/indexer/core/src/chain_consistency.rs index 8503bdd4..df4b5ba6 100644 --- a/lez/indexer/core/src/chain_consistency.rs +++ b/lez/indexer/core/src/chain_consistency.rs @@ -321,7 +321,6 @@ mod tests { allow_chain_reset: false, cross_zone: None, bridge_lock_holdings: Vec::new(), - deploy_programs: Vec::new(), }; IndexerCore::open(config, dir).expect("open core") } diff --git a/lez/indexer/core/src/config.rs b/lez/indexer/core/src/config.rs index 6f9da750..159da23c 100644 --- a/lez/indexer/core/src/config.rs +++ b/lez/indexer/core/src/config.rs @@ -2,7 +2,6 @@ use std::{fs::File, io::BufReader, path::Path, time::Duration}; use anyhow::{Context as _, Result}; use common::config::BasicAuth; -use cross_zone::CrossZoneProgram; use cross_zone_inbox_core::CrossZoneConfig; use humantime_serde; use lee::AccountId; @@ -38,12 +37,6 @@ pub struct IndexerConfig { /// Defaults to `false`: on mismatch the indexer refuses to start. #[serde(default)] pub allow_chain_reset: bool, - /// Cross-zone builtins to deploy at genesis, mirroring the sequencer's - /// `DeployProgram` actions so the replayed genesis is identical. This set - /// must match the sequencer's; compare the genesis fingerprint both nodes - /// log at startup to confirm. - #[serde(default)] - pub deploy_programs: Vec, } /// A genesis-funded bridge-lock holder balance, configured identically on the diff --git a/lez/indexer/core/src/lib.rs b/lez/indexer/core/src/lib.rs index b230568a..130d155b 100644 --- a/lez/indexer/core/src/lib.rs +++ b/lez/indexer/core/src/lib.rs @@ -93,8 +93,7 @@ impl IndexerCore { ); let zone_indexer = ZoneIndexer::new(config.channel_id, node.clone()); - // Cross-zone programs, mirroring the sequencer's DeployProgram set. - let genesis_programs = cross_zone::deployed_programs(&config.deploy_programs); + // Cross-zone programs are base builtins, so none are seeded here. // Bridge-lock holdings (source side) always; inbox + wrapped-token config only when // cross_zone is set. let mut genesis_accounts: Vec<_> = config @@ -113,7 +112,7 @@ impl IndexerCore { Ok(Self { zone_indexer: Arc::new(zone_indexer), - store: IndexerStore::open_db(&home, genesis_programs, genesis_accounts)?, + store: IndexerStore::open_db(&home, Vec::new(), genesis_accounts)?, node, config, status: Arc::new(ArcSwap::from_pointee(IndexerSyncStatus::starting())), diff --git a/lez/sequencer/core/src/config.rs b/lez/sequencer/core/src/config.rs index 8966a874..29c30a4f 100644 --- a/lez/sequencer/core/src/config.rs +++ b/lez/sequencer/core/src/config.rs @@ -8,7 +8,6 @@ use std::{ use anyhow::Result; use bytesize::ByteSize; use common::config::BasicAuth; -pub use cross_zone::CrossZoneProgram; pub use cross_zone_inbox_core::{CrossZoneConfig, CrossZonePeer}; use humantime_serde; use lee::{AccountId, Balance}; @@ -32,13 +31,6 @@ pub enum GenesisAction { holder: AccountId, amount: Balance, }, - /// Registers a cross-zone builtin at genesis, keeping the cross-zone programs - /// out of the production builtin set. A zone lists the ones it uses. This set - /// must match the indexer's `deploy_programs`, or the two genesis states - /// diverge; compare the genesis fingerprint both nodes log at startup. - DeployProgram { - program: CrossZoneProgram, - }, } // TODO: Provide default values diff --git a/lez/sequencer/core/src/lib.rs b/lez/sequencer/core/src/lib.rs index fccce81e..b12ce8c0 100644 --- a/lez/sequencer/core/src/lib.rs +++ b/lez/sequencer/core/src/lib.rs @@ -637,8 +637,8 @@ fn build_genesis_state(config: &SequencerConfig) -> (lee::V03State, Vec = bridge_lock_holdings(&config.genesis) .into_iter() @@ -670,11 +670,8 @@ fn build_genesis_state(config: &SequencerConfig) -> (lee::V03State, Vec { Some(build_supply_bridge_account_genesis_transaction(*balance)) } - // Seeded/registered directly (accounts via `cross_zone::genesis_accounts`, - // programs via `with_programs`), not by a genesis tx. - GenesisAction::SupplyBridgeLockHolding { .. } | GenesisAction::DeployProgram { .. } => { - None - } + // Seeded directly (accounts via `cross_zone::genesis_accounts`), not by a genesis tx. + GenesisAction::SupplyBridgeLockHolding { .. } => None, }) .chain(std::iter::once(clock_invocation(0))) .inspect(|tx| { @@ -694,28 +691,11 @@ fn bridge_lock_holdings(genesis: &[GenesisAction]) -> Vec<(lee::AccountId, lee:: .iter() .filter_map(|action| match action { GenesisAction::SupplyBridgeLockHolding { holder, amount } => Some((*holder, *amount)), - GenesisAction::SupplyAccount { .. } - | GenesisAction::SupplyBridgeAccount { .. } - | GenesisAction::DeployProgram { .. } => None, + GenesisAction::SupplyAccount { .. } | GenesisAction::SupplyBridgeAccount { .. } => None, }) .collect() } -/// The cross-zone builtins this zone deploys at genesis, from its `DeployProgram` -/// actions. -fn deployed_programs(genesis: &[GenesisAction]) -> Vec { - let selectors: Vec<_> = genesis - .iter() - .filter_map(|action| match action { - GenesisAction::DeployProgram { program } => Some(*program), - GenesisAction::SupplyAccount { .. } - | GenesisAction::SupplyBridgeAccount { .. } - | GenesisAction::SupplyBridgeLockHolding { .. } => None, - }) - .collect(); - cross_zone::deployed_programs(&selectors) -} - /// Whether a program may only be invoked by sequencer-origin transactions. /// /// The cross-zone inbox is injected solely by the watcher; a user-submitted call diff --git a/lez/testnet_initial_state/src/lib.rs b/lez/testnet_initial_state/src/lib.rs index 3296b953..f77a083f 100644 --- a/lez/testnet_initial_state/src/lib.rs +++ b/lez/testnet_initial_state/src/lib.rs @@ -271,6 +271,16 @@ fn initial_programs() -> Vec { programs::vault(), programs::faucet(), programs::bridge(), + // Cross-zone programs are builtins: their bytecode is baked into every node, + // so registering them in the base state (rather than shipping ELFs through + // the genesis block, which exceeds the inscription size limit) keeps the two + // nodes in lock-step with nothing to desync. + programs::cross_zone_inbox(), + programs::cross_zone_outbox(), + programs::ping_sender(), + programs::ping_receiver(), + programs::bridge_lock(), + programs::wrapped_token(), ] } diff --git a/test_fixtures/src/config.rs b/test_fixtures/src/config.rs index d6b61448..960f349b 100644 --- a/test_fixtures/src/config.rs +++ b/test_fixtures/src/config.rs @@ -6,9 +6,7 @@ use indexer_service::{ChannelId, ClientConfig, IndexerConfig}; use key_protocol::key_management::{KeyChain, secret_holders::SeedHolder}; use lee::{AccountId, PrivateKey, PublicKey}; use lee_core::Identifier; -use sequencer_core::config::{ - BedrockConfig, CrossZoneConfig, CrossZoneProgram, GenesisAction, SequencerConfig, -}; +use sequencer_core::config::{BedrockConfig, CrossZoneConfig, GenesisAction, SequencerConfig}; use url::Url; use wallet::config::WalletConfig; @@ -210,7 +208,6 @@ pub fn indexer_config( bedrock_addr: SocketAddr, channel_id: ChannelId, cross_zone: Option, - deploy_programs: Vec, ) -> Result { Ok(IndexerConfig { consensus_info_polling_interval: Duration::from_secs(1), @@ -223,26 +220,9 @@ pub fn indexer_config( cross_zone, bridge_lock_holdings: Vec::new(), allow_chain_reset: false, - deploy_programs, }) } -/// All cross-zone builtins as `DeployProgram` genesis actions, for a demo zone's -/// sequencer config. -#[must_use] -pub fn cross_zone_deploy_actions() -> Vec { - CrossZoneProgram::ALL - .into_iter() - .map(|program| GenesisAction::DeployProgram { program }) - .collect() -} - -/// All cross-zone builtins, for a demo zone's indexer `deploy_programs`. -#[must_use] -pub fn all_cross_zone_programs() -> Vec { - CrossZoneProgram::ALL.to_vec() -} - pub fn addr_to_url(protocol: UrlProtocol, addr: SocketAddr) -> Result { // Convert 0.0.0.0 to 127.0.0.1 for client connections // When binding to port 0, the server binds to 0.0.0.0: @@ -275,58 +255,3 @@ pub fn bedrock_channel_id_b() -> ChannelId { .unwrap_or_else(|_| unreachable!()); ChannelId::from(channel_id) } - -#[cfg(test)] -mod tests { - use super::*; - - /// A demo zone declares its cross-zone deploy set twice: as the sequencer's - /// `DeployProgram` genesis actions and as the indexer's `deploy_programs`. Pin - /// the two helpers to the same genesis fingerprint, and check the fingerprint - /// actually detects a divergent set and ignores registration order, since that - /// is what makes it a usable drift guard. - #[test] - fn cross_zone_demo_genesis_matches_across_sequencer_and_indexer() { - let seq_selectors: Vec = cross_zone_deploy_actions() - .into_iter() - .filter_map(|action| match action { - GenesisAction::DeployProgram { program } => Some(program), - GenesisAction::SupplyAccount { .. } - | GenesisAction::SupplyBridgeAccount { .. } - | GenesisAction::SupplyBridgeLockHolding { .. } => None, - }) - .collect(); - let idx_selectors = all_cross_zone_programs(); - - let fingerprint = |selectors: &[CrossZoneProgram]| { - lee::V03State::new() - .with_programs(selectors.iter().map(|p| p.program())) - .genesis_fingerprint() - }; - - // Matched configs agree. - assert_eq!( - fingerprint(&seq_selectors), - fingerprint(&idx_selectors), - "sequencer DeployProgram set and indexer deploy_programs must agree" - ); - - // A dropped program on one side changes the fingerprint. - let mut drifted = idx_selectors.clone(); - drifted.pop().expect("deploy set is non-empty"); - assert_ne!( - fingerprint(&seq_selectors), - fingerprint(&drifted), - "genesis fingerprint must detect a divergent deploy set" - ); - - // Registration order does not change the fingerprint. - let mut reversed = idx_selectors.clone(); - reversed.reverse(); - assert_eq!( - fingerprint(&idx_selectors), - fingerprint(&reversed), - "genesis fingerprint must be independent of program order" - ); - } -} diff --git a/test_fixtures/src/lib.rs b/test_fixtures/src/lib.rs index f2d06b69..687da077 100644 --- a/test_fixtures/src/lib.rs +++ b/test_fixtures/src/lib.rs @@ -337,7 +337,7 @@ impl TestContextBuilder { let indexer_components = if enable_indexer { let (indexer_handle, temp_indexer_dir) = - setup_indexer(bedrock_addr, config::bedrock_channel_id(), None, Vec::new()) + setup_indexer(bedrock_addr, config::bedrock_channel_id(), None) .await .context("Failed to setup Indexer")?; let indexer_url = config::addr_to_url(config::UrlProtocol::Ws, indexer_handle.addr()) diff --git a/test_fixtures/src/setup.rs b/test_fixtures/src/setup.rs index afe56712..325e1628 100644 --- a/test_fixtures/src/setup.rs +++ b/test_fixtures/src/setup.rs @@ -116,7 +116,6 @@ pub async fn setup_indexer( bedrock_addr: SocketAddr, channel_id: ChannelId, cross_zone: Option, - deploy_programs: Vec, ) -> Result<(IndexerHandle, TempDir)> { let temp_indexer_dir = tempfile::tempdir().context("Failed to create temp dir for indexer home")?; @@ -126,9 +125,8 @@ pub async fn setup_indexer( temp_indexer_dir.path().display() ); - let indexer_config = - config::indexer_config(bedrock_addr, channel_id, cross_zone, deploy_programs) - .context("Failed to create Indexer config")?; + let indexer_config = config::indexer_config(bedrock_addr, channel_id, cross_zone) + .context("Failed to create Indexer config")?; indexer_service::run_server( indexer_config, diff --git a/tools/cross_zone_chat/src/main.rs b/tools/cross_zone_chat/src/main.rs index 0d29e56f..4347cc93 100644 --- a/tools/cross_zone_chat/src/main.rs +++ b/tools/cross_zone_chat/src/main.rs @@ -292,7 +292,7 @@ async fn main() -> Result<()> { let (seq_a, _home_a) = setup_sequencer( partial, bedrock_addr, - config::cross_zone_deploy_actions(), + vec![], channel_a, Some(cross_zone_a), ) @@ -301,7 +301,7 @@ async fn main() -> Result<()> { let (seq_b, _home_b) = setup_sequencer( partial, bedrock_addr, - config::cross_zone_deploy_actions(), + vec![], channel_b, Some(cross_zone_b), )