diff --git a/backend/canisters/cycles_dispenser/CHANGELOG.md b/backend/canisters/cycles_dispenser/CHANGELOG.md index ca72fe7d3a..7eade02b43 100644 --- a/backend/canisters/cycles_dispenser/CHANGELOG.md +++ b/backend/canisters/cycles_dispenser/CHANGELOG.md @@ -6,6 +6,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ## [unreleased] +## [[2.0.1527](https://github.com/open-chat-labs/open-chat/releases/tag/v2.0.1527-cycles_dispenser)] - 2024-12-19 + ### Changed - Allow Registry to add additional canisters to the allow list ([#7072](https://github.com/open-chat-labs/open-chat/pull/7072)) diff --git a/backend/canisters/cycles_dispenser/impl/src/lib.rs b/backend/canisters/cycles_dispenser/impl/src/lib.rs index f6da08ad8f..d9d1d656b9 100644 --- a/backend/canisters/cycles_dispenser/impl/src/lib.rs +++ b/backend/canisters/cycles_dispenser/impl/src/lib.rs @@ -71,7 +71,6 @@ impl State { struct Data { pub governance_principals: HashSet, pub canisters: Canisters, - #[serde(default = "CanisterId::anonymous")] pub registry_canister_id: CanisterId, pub sns_root_canister: Option, pub max_top_up_amount: Cycles, diff --git a/backend/canisters/cycles_dispenser/impl/src/lifecycle/post_upgrade.rs b/backend/canisters/cycles_dispenser/impl/src/lifecycle/post_upgrade.rs index 4ef3af1c7e..22bfb1ef28 100644 --- a/backend/canisters/cycles_dispenser/impl/src/lifecycle/post_upgrade.rs +++ b/backend/canisters/cycles_dispenser/impl/src/lifecycle/post_upgrade.rs @@ -7,7 +7,6 @@ use cycles_dispenser_canister::post_upgrade::Args; use ic_cdk::post_upgrade; use stable_memory::get_reader; use tracing::info; -use types::CanisterId; #[post_upgrade] #[trace] @@ -15,15 +14,9 @@ fn post_upgrade(args: Args) { let memory = get_upgrades_memory(); let reader = get_reader(&memory); - let (mut data, errors, logs, traces): (Data, Vec, Vec, Vec) = + let (data, errors, logs, traces): (Data, Vec, Vec, Vec) = msgpack::deserialize(reader).unwrap(); - if data.test_mode { - data.registry_canister_id = CanisterId::from_text("cglwi-oaaaa-aaaar-aqw4q-cai").unwrap(); - } else { - data.registry_canister_id = CanisterId::from_text("cpi5u-yiaaa-aaaar-aqw5a-cai").unwrap(); - } - canister_logger::init_with_logs(data.test_mode, errors, logs, traces); let env = init_env(data.rng_seed); diff --git a/backend/canisters/escrow/CHANGELOG.md b/backend/canisters/escrow/CHANGELOG.md index 2d661aa294..97ade718cb 100644 --- a/backend/canisters/escrow/CHANGELOG.md +++ b/backend/canisters/escrow/CHANGELOG.md @@ -6,6 +6,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ## [unreleased] +## [[2.0.1526](https://github.com/open-chat-labs/open-chat/releases/tag/v2.0.1526-escrow)] - 2024-12-19 + ### Changed - Disallow P2P swaps of disabled tokens ([#7057](https://github.com/open-chat-labs/open-chat/pull/7057)) diff --git a/backend/canisters/escrow/impl/src/lib.rs b/backend/canisters/escrow/impl/src/lib.rs index a3c4f1b619..13f8c0daa8 100644 --- a/backend/canisters/escrow/impl/src/lib.rs +++ b/backend/canisters/escrow/impl/src/lib.rs @@ -66,10 +66,8 @@ struct Data { pub pending_payments_queue: PendingPaymentsQueue, pub notify_status_change_queue: NotifyStatusChangeQueue, timer_jobs: TimerJobs, - #[serde(default = "CanisterId::anonymous")] pub registry_canister_id: CanisterId, pub cycles_dispenser_canister_id: CanisterId, - #[serde(default)] pub disabled_tokens: BTreeSet, pub rng_seed: [u8; 32], pub test_mode: bool, diff --git a/backend/canisters/escrow/impl/src/lifecycle/post_upgrade.rs b/backend/canisters/escrow/impl/src/lifecycle/post_upgrade.rs index 37844b04b4..a134fb81e8 100644 --- a/backend/canisters/escrow/impl/src/lifecycle/post_upgrade.rs +++ b/backend/canisters/escrow/impl/src/lifecycle/post_upgrade.rs @@ -7,7 +7,6 @@ use escrow_canister::post_upgrade::Args; use ic_cdk::post_upgrade; use stable_memory::get_reader; use tracing::info; -use types::CanisterId; use utils::cycles::init_cycles_dispenser_client; #[post_upgrade] @@ -16,15 +15,9 @@ fn post_upgrade(args: Args) { let memory = get_upgrades_memory(); let reader = get_reader(&memory); - let (mut data, errors, logs, traces): (Data, Vec, Vec, Vec) = + let (data, errors, logs, traces): (Data, Vec, Vec, Vec) = msgpack::deserialize(reader).unwrap(); - if data.test_mode { - data.registry_canister_id = CanisterId::from_text("cglwi-oaaaa-aaaar-aqw4q-cai").unwrap(); - } else { - data.registry_canister_id = CanisterId::from_text("cpi5u-yiaaa-aaaar-aqw5a-cai").unwrap(); - } - canister_logger::init_with_logs(data.test_mode, errors, logs, traces); let env = init_env(data.rng_seed); diff --git a/backend/canisters/event_relay/CHANGELOG.md b/backend/canisters/event_relay/CHANGELOG.md index 5b218e19c6..bffb6f13b7 100644 --- a/backend/canisters/event_relay/CHANGELOG.md +++ b/backend/canisters/event_relay/CHANGELOG.md @@ -6,6 +6,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ## [unreleased] +## [[2.0.1525](https://github.com/open-chat-labs/open-chat/releases/tag/v2.0.1525-event_relay)] - 2024-12-19 + ### Added - Add an error log with http endpoint ([#6608](https://github.com/open-chat-labs/open-chat/pull/6608)) diff --git a/backend/canisters/event_relay/impl/src/lib.rs b/backend/canisters/event_relay/impl/src/lib.rs index d672255e8c..99429a08d4 100644 --- a/backend/canisters/event_relay/impl/src/lib.rs +++ b/backend/canisters/event_relay/impl/src/lib.rs @@ -76,7 +76,6 @@ struct Data { pub event_store_client: EventStoreClient, pub event_deduper: EventDeduper, pub cycles_dispenser_canister_id: CanisterId, - #[serde(default = "CanisterId::anonymous")] pub registry_canister_id: CanisterId, pub chat_ledger_canister_id: CanisterId, pub chat_governance_canister_id: CanisterId, diff --git a/backend/canisters/event_relay/impl/src/lifecycle/post_upgrade.rs b/backend/canisters/event_relay/impl/src/lifecycle/post_upgrade.rs index e2ae35ccaa..2b041a55c6 100644 --- a/backend/canisters/event_relay/impl/src/lifecycle/post_upgrade.rs +++ b/backend/canisters/event_relay/impl/src/lifecycle/post_upgrade.rs @@ -7,7 +7,6 @@ use event_relay_canister::post_upgrade::Args; use ic_cdk::post_upgrade; use stable_memory::get_reader; use tracing::info; -use types::CanisterId; use utils::cycles::init_cycles_dispenser_client; #[post_upgrade] @@ -16,17 +15,10 @@ fn post_upgrade(args: Args) { let memory = get_upgrades_memory(); let reader = get_reader(&memory); - let (mut data, logs, traces): (Data, Vec, Vec) = msgpack::deserialize(reader).unwrap(); + let (data, errors, logs, traces): (Data, Vec, Vec, Vec) = + msgpack::deserialize(reader).unwrap(); - if data.test_mode { - data.registry_canister_id = CanisterId::from_text("cglwi-oaaaa-aaaar-aqw4q-cai").unwrap(); - } else { - data.registry_canister_id = CanisterId::from_text("cpi5u-yiaaa-aaaar-aqw5a-cai").unwrap(); - } - - // TODO: After release change this to - // let (data, errors, logs, traces): (Data, Vec, Vec, Vec) = msgpack::deserialize(reader).unwrap(); - canister_logger::init_with_logs(data.test_mode, Vec::new(), logs, traces); + canister_logger::init_with_logs(data.test_mode, errors, logs, traces); let env = init_env(data.rng_seed); init_cycles_dispenser_client(data.cycles_dispenser_canister_id, data.test_mode); diff --git a/backend/canisters/group_index/CHANGELOG.md b/backend/canisters/group_index/CHANGELOG.md index 6bfccfefd2..f232680c36 100644 --- a/backend/canisters/group_index/CHANGELOG.md +++ b/backend/canisters/group_index/CHANGELOG.md @@ -6,6 +6,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ## [unreleased] +## [[2.0.1519](https://github.com/open-chat-labs/open-chat/releases/tag/v2.0.1519-group_index)] - 2024-12-19 + ### Changed - Allow Registry to add additional LocalGroupIndexes ([#7072](https://github.com/open-chat-labs/open-chat/pull/7072)) diff --git a/backend/canisters/group_index/impl/src/lib.rs b/backend/canisters/group_index/impl/src/lib.rs index d2cb1c606e..6bdbf3884c 100644 --- a/backend/canisters/group_index/impl/src/lib.rs +++ b/backend/canisters/group_index/impl/src/lib.rs @@ -155,7 +155,6 @@ struct Data { pub proposals_bot_user_id: UserId, pub escrow_canister_id: CanisterId, pub event_relay_canister_id: CanisterId, - #[serde(default = "CanisterId::anonymous")] pub registry_canister_id: CanisterId, pub internet_identity_canister_id: CanisterId, pub canisters_requiring_upgrade: CanistersRequiringUpgrade, diff --git a/backend/canisters/group_index/impl/src/lifecycle/post_upgrade.rs b/backend/canisters/group_index/impl/src/lifecycle/post_upgrade.rs index 88e48a57e0..b8eb669225 100644 --- a/backend/canisters/group_index/impl/src/lifecycle/post_upgrade.rs +++ b/backend/canisters/group_index/impl/src/lifecycle/post_upgrade.rs @@ -7,7 +7,6 @@ use group_index_canister::post_upgrade::Args; use ic_cdk::post_upgrade; use stable_memory::get_reader; use tracing::info; -use types::CanisterId; use utils::cycles::init_cycles_dispenser_client; #[post_upgrade] @@ -16,15 +15,9 @@ fn post_upgrade(args: Args) { let memory = get_upgrades_memory(); let reader = get_reader(&memory); - let (mut data, errors, logs, traces): (Data, Vec, Vec, Vec) = + let (data, errors, logs, traces): (Data, Vec, Vec, Vec) = msgpack::deserialize(reader).unwrap(); - if data.test_mode { - data.registry_canister_id = CanisterId::from_text("cglwi-oaaaa-aaaar-aqw4q-cai").unwrap(); - } else { - data.registry_canister_id = CanisterId::from_text("cpi5u-yiaaa-aaaar-aqw5a-cai").unwrap(); - } - canister_logger::init_with_logs(data.test_mode, errors, logs, traces); let env = init_env(data.rng_seed); diff --git a/backend/canisters/local_group_index/CHANGELOG.md b/backend/canisters/local_group_index/CHANGELOG.md index bb1fe4c51d..98774ed6c8 100644 --- a/backend/canisters/local_group_index/CHANGELOG.md +++ b/backend/canisters/local_group_index/CHANGELOG.md @@ -6,6 +6,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ## [unreleased] +## [[2.0.1531](https://github.com/open-chat-labs/open-chat/releases/tag/v2.0.1531-local_group_index)] - 2024-12-19 + ### Changed - Handle installing large wasms onto new subnets ([#7078](https://github.com/open-chat-labs/open-chat/pull/7078)) diff --git a/backend/canisters/local_user_index/CHANGELOG.md b/backend/canisters/local_user_index/CHANGELOG.md index 5e3fee776c..5ac4230f11 100644 --- a/backend/canisters/local_user_index/CHANGELOG.md +++ b/backend/canisters/local_user_index/CHANGELOG.md @@ -6,6 +6,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ## [unreleased] +## [[2.0.1530](https://github.com/open-chat-labs/open-chat/releases/tag/v2.0.1530-local_user_index)] - 2024-12-19 + ### Added - Implement streak insurance ([#7036](https://github.com/open-chat-labs/open-chat/pull/7036)) diff --git a/backend/canisters/neuron_controller/CHANGELOG.md b/backend/canisters/neuron_controller/CHANGELOG.md index 5166faa2d5..3ec0b32eef 100644 --- a/backend/canisters/neuron_controller/CHANGELOG.md +++ b/backend/canisters/neuron_controller/CHANGELOG.md @@ -6,6 +6,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ## [unreleased] +## [[2.0.1523](https://github.com/open-chat-labs/open-chat/releases/tag/v2.0.1523-neuron_controller)] - 2024-12-19 + ### Changed - Expose size of each virtual stable memory in metrics ([#6981](https://github.com/open-chat-labs/open-chat/pull/6981)) diff --git a/backend/canisters/notifications_index/CHANGELOG.md b/backend/canisters/notifications_index/CHANGELOG.md index f9b1a59647..93506aee96 100644 --- a/backend/canisters/notifications_index/CHANGELOG.md +++ b/backend/canisters/notifications_index/CHANGELOG.md @@ -6,6 +6,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ## [unreleased] +## [[2.0.1529](https://github.com/open-chat-labs/open-chat/releases/tag/v2.0.1529-notifications_index)] - 2024-12-19 + ### Changed - Allow Registry to add additional Notifications canisters ([#7072](https://github.com/open-chat-labs/open-chat/pull/7072)) diff --git a/backend/canisters/notifications_index/impl/src/lib.rs b/backend/canisters/notifications_index/impl/src/lib.rs index 8c0a00ebdb..0893f01ad0 100644 --- a/backend/canisters/notifications_index/impl/src/lib.rs +++ b/backend/canisters/notifications_index/impl/src/lib.rs @@ -123,7 +123,6 @@ struct Data { pub push_service_principals: HashSet, pub user_index_canister_id: CanisterId, pub cycles_dispenser_canister_id: CanisterId, - #[serde(default = "CanisterId::anonymous")] pub registry_canister_id: CanisterId, pub principal_to_user_id_map: PrincipalToUserIdMap, pub subscriptions: Subscriptions, diff --git a/backend/canisters/notifications_index/impl/src/lifecycle/post_upgrade.rs b/backend/canisters/notifications_index/impl/src/lifecycle/post_upgrade.rs index 19ffa2ae92..cd384aa0a5 100644 --- a/backend/canisters/notifications_index/impl/src/lifecycle/post_upgrade.rs +++ b/backend/canisters/notifications_index/impl/src/lifecycle/post_upgrade.rs @@ -7,7 +7,6 @@ use ic_cdk::post_upgrade; use notifications_index_canister::post_upgrade::Args; use stable_memory::get_reader; use tracing::info; -use types::CanisterId; use utils::cycles::init_cycles_dispenser_client; #[post_upgrade] @@ -18,15 +17,9 @@ fn post_upgrade(args: Args) { let memory = get_upgrades_memory(); let reader = get_reader(&memory); - let (mut data, errors, logs, traces): (Data, Vec, Vec, Vec) = + let (data, errors, logs, traces): (Data, Vec, Vec, Vec) = msgpack::deserialize(reader).unwrap(); - if data.test_mode { - data.registry_canister_id = CanisterId::from_text("cglwi-oaaaa-aaaar-aqw4q-cai").unwrap(); - } else { - data.registry_canister_id = CanisterId::from_text("cpi5u-yiaaa-aaaar-aqw5a-cai").unwrap(); - } - canister_logger::init_with_logs(data.test_mode, errors, logs, traces); let env = init_env(data.rng_seed); diff --git a/backend/canisters/proposals_bot/CHANGELOG.md b/backend/canisters/proposals_bot/CHANGELOG.md index 77591ad608..8f6036ad34 100644 --- a/backend/canisters/proposals_bot/CHANGELOG.md +++ b/backend/canisters/proposals_bot/CHANGELOG.md @@ -6,6 +6,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ## [unreleased] +## [[2.0.1534](https://github.com/open-chat-labs/open-chat/releases/tag/v2.0.1534-proposals_bot)] - 2024-12-19 + ### Changed - Generate 64bit message Ids ([#6978](https://github.com/open-chat-labs/open-chat/pull/6978)) diff --git a/backend/canisters/registry/CHANGELOG.md b/backend/canisters/registry/CHANGELOG.md index 6a60efbca5..91e88467ea 100644 --- a/backend/canisters/registry/CHANGELOG.md +++ b/backend/canisters/registry/CHANGELOG.md @@ -6,6 +6,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ## [unreleased] +## [[2.0.1524](https://github.com/open-chat-labs/open-chat/releases/tag/v2.0.1524-registry)] - 2024-12-19 + ### Added - Implement ability to expand onto additional subnets ([#7072](https://github.com/open-chat-labs/open-chat/pull/7072)) diff --git a/backend/canisters/registry/impl/src/lib.rs b/backend/canisters/registry/impl/src/lib.rs index aebeb9edc9..f91f0602c4 100644 --- a/backend/canisters/registry/impl/src/lib.rs +++ b/backend/canisters/registry/impl/src/lib.rs @@ -87,19 +87,13 @@ struct Data { governance_principals: HashSet, proposals_bot_canister_id: CanisterId, user_index_canister_id: CanisterId, - #[serde(default = "CanisterId::anonymous")] group_index_canister_id: CanisterId, - #[serde(default = "CanisterId::anonymous")] notifications_index_canister_id: CanisterId, - #[serde(default = "CanisterId::anonymous")] event_relay_canister_id: CanisterId, sns_wasm_canister_id: CanisterId, - #[serde(default = "CanisterId::anonymous")] escrow_canister_id: CanisterId, cycles_dispenser_canister_id: CanisterId, - #[serde(default = "CanisterId::anonymous")] icp_ledger_canister_id: CanisterId, - #[serde(default = "CanisterId::anonymous")] cycles_minting_canister_id: CanisterId, tokens: Tokens, nervous_systems: NervousSystems, @@ -109,9 +103,7 @@ struct Data { total_supply: Timestamped, circulating_supply: Timestamped, airdrop_config: Timestamped>, - #[serde(default)] subnets: Subnets, - #[serde(default)] timer_jobs: TimerJobs, rng_seed: [u8; 32], test_mode: bool, diff --git a/backend/canisters/registry/impl/src/lifecycle/post_upgrade.rs b/backend/canisters/registry/impl/src/lifecycle/post_upgrade.rs index dfb2eefd54..2b1c02e4ab 100644 --- a/backend/canisters/registry/impl/src/lifecycle/post_upgrade.rs +++ b/backend/canisters/registry/impl/src/lifecycle/post_upgrade.rs @@ -1,16 +1,12 @@ use crate::lifecycle::{init_env, init_state}; use crate::memory::get_upgrades_memory; -use crate::{read_state, Data}; -use candid::Principal; +use crate::Data; use canister_logger::LogEntry; use canister_tracing_macros::trace; use ic_cdk::post_upgrade; use registry_canister::post_upgrade::Args; -use registry_canister::subnets::Subnet; use stable_memory::get_reader; -use std::time::Duration; use tracing::info; -use types::CanisterId; use utils::cycles::init_cycles_dispenser_client; #[post_upgrade] @@ -19,44 +15,9 @@ fn post_upgrade(args: Args) { let memory = get_upgrades_memory(); let reader = get_reader(&memory); - let (mut data, errors, logs, traces): (Data, Vec, Vec, Vec) = + let (data, errors, logs, traces): (Data, Vec, Vec, Vec) = msgpack::deserialize(reader).unwrap(); - if data.test_mode { - data.group_index_canister_id = CanisterId::from_text("7kifq-3yaaa-aaaaf-ab2cq-cai").unwrap(); - data.notifications_index_canister_id = CanisterId::from_text("4glvk-ryaaa-aaaaf-aaaia-cai").unwrap(); - data.event_relay_canister_id = CanisterId::from_text("6jejw-xyaaa-aaaaf-biiba-cai").unwrap(); - data.escrow_canister_id = CanisterId::from_text("tspqt-xaaaa-aaaal-qcnna-cai").unwrap(); - - data.subnets.subnets.push(Subnet { - subnet_id: Principal::from_text("eq6en-6jqla-fbu5s-daskr-h6hx2-376n5-iqabl-qgrng-gfqmv-n3yjr-mqe").unwrap(), - local_user_index: CanisterId::from_text("pecvb-tqaaa-aaaaf-bhdiq-cai").unwrap(), - local_group_index: CanisterId::from_text("sbhuw-gyaaa-aaaaf-bfynq-cai").unwrap(), - notifications_canister: CanisterId::from_text("dhcdh-fqaaa-aaaaf-adnmq-cai").unwrap(), - }); - } else { - data.group_index_canister_id = CanisterId::from_text("4ijyc-kiaaa-aaaaf-aaaja-cai").unwrap(); - data.notifications_index_canister_id = CanisterId::from_text("7ekiy-aiaaa-aaaaf-ab2dq-cai").unwrap(); - data.event_relay_canister_id = CanisterId::from_text("6ofpc-2aaaa-aaaaf-biibq-cai").unwrap(); - data.escrow_canister_id = CanisterId::from_text("s4yi7-yiaaa-aaaar-qacpq-cai").unwrap(); - - data.subnets.subnets.push(Subnet { - subnet_id: Principal::from_text("eq6en-6jqla-fbu5s-daskr-h6hx2-376n5-iqabl-qgrng-gfqmv-n3yjr-mqe").unwrap(), - local_user_index: CanisterId::from_text("nq4qv-wqaaa-aaaaf-bhdgq-cai").unwrap(), - local_group_index: CanisterId::from_text("suaf3-hqaaa-aaaaf-bfyoa-cai").unwrap(), - notifications_canister: CanisterId::from_text("dobi3-tyaaa-aaaaf-adnna-cai").unwrap(), - }); - - data.subnets.subnets.push(Subnet { - subnet_id: Principal::from_text("2fq7c-slacv-26cgz-vzbx2-2jrcs-5edph-i5s2j-tck77-c3rlz-iobzx-mqe").unwrap(), - local_user_index: CanisterId::from_text("aboy3-giaaa-aaaar-aaaaq-cai").unwrap(), - local_group_index: CanisterId::from_text("ainth-qaaaa-aaaar-aaaba-cai").unwrap(), - notifications_canister: CanisterId::from_text("apmvt-5yaaa-aaaar-aaabq-cai").unwrap(), - }); - } - data.icp_ledger_canister_id = CanisterId::from_text("ryjl3-tyaaa-aaaaa-aaaba-cai").unwrap(); - data.cycles_minting_canister_id = CanisterId::from_text("rkp4c-7iaaa-aaaaa-aaaca-cai").unwrap(); - canister_logger::init_with_logs(data.test_mode, errors, logs, traces); let env = init_env(data.rng_seed); @@ -64,32 +25,4 @@ fn post_upgrade(args: Args) { init_state(env, data, args.wasm_version); info!(version = %args.wasm_version, "Post-upgrade complete"); - - ic_cdk_timers::set_timer(Duration::ZERO, || ic_cdk::spawn(set_disabled_tokens_in_escrow_canister())); -} - -async fn set_disabled_tokens_in_escrow_canister() { - let (disabled_tokens, escrow_canister_id) = read_state(|state| { - let disabled_tokens: Vec<_> = state - .data - .tokens - .iter() - .filter(|t| !t.enabled) - .map(|t| t.ledger_canister_id) - .collect(); - - (disabled_tokens, state.data.escrow_canister_id) - }); - - for ledger_canister_id in disabled_tokens { - escrow_canister_c2c_client::c2c_set_token_enabled( - escrow_canister_id, - &escrow_canister::c2c_set_token_enabled::Args { - ledger_canister_id, - enabled: false, - }, - ) - .await - .unwrap(); - } } diff --git a/backend/canisters/storage_bucket/impl/src/lib.rs b/backend/canisters/storage_bucket/impl/src/lib.rs index b740718e8a..7b2bc445d4 100644 --- a/backend/canisters/storage_bucket/impl/src/lib.rs +++ b/backend/canisters/storage_bucket/impl/src/lib.rs @@ -1,6 +1,5 @@ use crate::model::files::{Files, RemoveFileResult}; use crate::model::index_event_batch::{EventToSync, IndexEventBatch}; -use crate::model::index_sync_state::IndexSyncState; use crate::model::users::Users; use candid::{CandidType, Principal}; use canister_state_macros::canister_state; @@ -79,9 +78,6 @@ struct Data { storage_index_canister_id: CanisterId, users: Users, files: Files, - #[deprecated] - index_sync_state: IndexSyncState, - #[serde(default = "index_event_sync_queue")] index_event_sync_queue: GroupedTimerJobQueue, created: TimestampMillis, freezing_limit: Timestamped>, @@ -89,10 +85,6 @@ struct Data { test_mode: bool, } -fn index_event_sync_queue() -> GroupedTimerJobQueue { - GroupedTimerJobQueue::new(1, false) -} - impl Data { pub fn new(storage_index_canister_id: CanisterId, now: TimestampMillis, test_mode: bool) -> Data { #[allow(deprecated)] @@ -100,7 +92,6 @@ impl Data { storage_index_canister_id, users: Users::default(), files: Files::default(), - index_sync_state: IndexSyncState::default(), index_event_sync_queue: GroupedTimerJobQueue::new(1, false), created: now, freezing_limit: Timestamped::default(), diff --git a/backend/canisters/storage_bucket/impl/src/lifecycle/post_upgrade.rs b/backend/canisters/storage_bucket/impl/src/lifecycle/post_upgrade.rs index caa9c2bb15..7b3b2c2de6 100644 --- a/backend/canisters/storage_bucket/impl/src/lifecycle/post_upgrade.rs +++ b/backend/canisters/storage_bucket/impl/src/lifecycle/post_upgrade.rs @@ -1,6 +1,5 @@ use crate::lifecycle::{init_env, init_state}; use crate::memory::get_upgrades_memory; -use crate::model::index_event_batch::EventToSync; use crate::Data; use canister_logger::LogEntry; use canister_tracing_macros::trace; @@ -15,26 +14,9 @@ fn post_upgrade(args: Args) { let memory = get_upgrades_memory(); let reader = get_reader(&memory); - let (mut data, errors, logs, traces): (Data, Vec, Vec, Vec) = + let (data, errors, logs, traces): (Data, Vec, Vec, Vec) = msgpack::deserialize(reader).unwrap(); - data.index_event_sync_queue.set_defer_processing(true); - #[allow(deprecated)] - { - if let Some(args) = data.index_sync_state.args_to_retry.take() { - for added in args.files_added { - data.push_event_to_index(EventToSync::FileAdded(added)); - } - for removed in args.files_removed { - data.push_event_to_index(EventToSync::FileRemoved(removed)); - } - } - for event in std::mem::take(&mut data.index_sync_state.queue) { - data.push_event_to_index(event) - } - } - data.index_event_sync_queue.set_defer_processing(false); - canister_logger::init_with_logs(data.test_mode, errors, logs, traces); let env = init_env(data.rng_seed); diff --git a/backend/canisters/storage_bucket/impl/src/model/index_sync_state.rs b/backend/canisters/storage_bucket/impl/src/model/index_sync_state.rs deleted file mode 100644 index 376414eba3..0000000000 --- a/backend/canisters/storage_bucket/impl/src/model/index_sync_state.rs +++ /dev/null @@ -1,13 +0,0 @@ -use crate::model::index_event_batch::EventToSync; -use serde::{Deserialize, Serialize}; -use std::collections::VecDeque; -use storage_index_canister::c2c_sync_bucket::Args; - -// We want to send events to the index in order, so while a sync is in progress we avoid sending -// more events in case the first batch fails and the second succeeds. If a sync fails, the args that -// were sent are stored so that they can be retried again. -#[derive(Serialize, Deserialize, Default)] -pub struct IndexSyncState { - pub queue: VecDeque, - pub args_to_retry: Option, -} diff --git a/backend/canisters/storage_bucket/impl/src/model/mod.rs b/backend/canisters/storage_bucket/impl/src/model/mod.rs index 585f0b22f4..cb7b4eaba8 100644 --- a/backend/canisters/storage_bucket/impl/src/model/mod.rs +++ b/backend/canisters/storage_bucket/impl/src/model/mod.rs @@ -1,5 +1,4 @@ pub mod files; pub mod index_event_batch; -pub mod index_sync_state; pub mod stable_blob_storage; pub mod users; diff --git a/backend/canisters/user_index/CHANGELOG.md b/backend/canisters/user_index/CHANGELOG.md index 22db5f4e0e..1270ced8f6 100644 --- a/backend/canisters/user_index/CHANGELOG.md +++ b/backend/canisters/user_index/CHANGELOG.md @@ -6,6 +6,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ## [unreleased] +## [[2.0.1533](https://github.com/open-chat-labs/open-chat/releases/tag/v2.0.1533-user_index)] - 2024-12-19 + ### Changed - Allow Registry to add additional LocalUserIndexes ([#7072](https://github.com/open-chat-labs/open-chat/pull/7072)) diff --git a/backend/canisters/user_index/impl/src/lib.rs b/backend/canisters/user_index/impl/src/lib.rs index d392872126..9064b7c2d9 100644 --- a/backend/canisters/user_index/impl/src/lib.rs +++ b/backend/canisters/user_index/impl/src/lib.rs @@ -347,7 +347,6 @@ struct Data { pub storage_index_canister_id: CanisterId, pub escrow_canister_id: CanisterId, pub translations_canister_id: CanisterId, - #[serde(default = "CanisterId::anonymous")] pub registry_canister_id: CanisterId, pub event_store_client: EventStoreClient, pub storage_index_user_sync_queue: GroupedTimerJobQueue, @@ -383,7 +382,6 @@ struct Data { pub survey_messages_sent: usize, pub external_achievements: ExternalAchievements, pub upload_wasm_chunks_whitelist: Vec, - #[serde(default)] pub streak_insurance_logs: StreakInsuranceLogs, } diff --git a/backend/canisters/user_index/impl/src/lifecycle/post_upgrade.rs b/backend/canisters/user_index/impl/src/lifecycle/post_upgrade.rs index 3add1718ce..d2761e052e 100644 --- a/backend/canisters/user_index/impl/src/lifecycle/post_upgrade.rs +++ b/backend/canisters/user_index/impl/src/lifecycle/post_upgrade.rs @@ -6,7 +6,6 @@ use canister_tracing_macros::trace; use ic_cdk::post_upgrade; use stable_memory::get_reader; use tracing::info; -use types::CanisterId; use user_index_canister::post_upgrade::Args; use utils::cycles::init_cycles_dispenser_client; @@ -16,15 +15,9 @@ fn post_upgrade(args: Args) { let memory = get_upgrades_memory(); let reader = get_reader(&memory); - let (mut data, errors, logs, traces): (Data, Vec, Vec, Vec) = + let (data, errors, logs, traces): (Data, Vec, Vec, Vec) = msgpack::deserialize(reader).unwrap(); - if data.test_mode { - data.registry_canister_id = CanisterId::from_text("cglwi-oaaaa-aaaar-aqw4q-cai").unwrap(); - } else { - data.registry_canister_id = CanisterId::from_text("cpi5u-yiaaa-aaaar-aqw5a-cai").unwrap(); - } - canister_logger::init_with_logs(data.test_mode, errors, logs, traces); let env = init_env(data.rng_seed, data.oc_key_pair.is_initialised());