Skip to content

Commit

Permalink
Update canisters post release (#6735)
Browse files Browse the repository at this point in the history
  • Loading branch information
hpeebles authored Nov 6, 2024
1 parent 92f608a commit a641a0f
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 24 deletions.
2 changes: 2 additions & 0 deletions backend/canisters/local_group_index/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

## [unreleased]

## [[2.0.1427](https://github.com/open-chat-labs/open-chat/releases/tag/v2.0.1427-local_group_index)] - 2024-11-06

### Added

- Trigger migrating Group/Community events to stable memory using canister timer job ([#6671](https://github.com/open-chat-labs/open-chat/pull/6671))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,10 @@ use crate::Data;
use candid::Principal;
use canister_logger::LogEntry;
use canister_tracing_macros::trace;
use ic_cdk::api::management_canister::main::{CanisterSettings, UpdateSettingsArgument};
use ic_cdk::post_upgrade;
use local_group_index_canister::post_upgrade::Args;
use stable_memory::get_reader;
use std::time::Duration;
use tracing::info;
use types::CanisterId;
use utils::cycles::init_cycles_dispenser_client;

#[post_upgrade]
Expand All @@ -31,25 +28,9 @@ fn post_upgrade(args: Args) {
.chain(data.local_communities.iter().map(|(c, _)| Principal::from(*c)))
.collect();

if !data.test_mode {
ic_cdk_timers::set_timer(Duration::ZERO, || ic_cdk::spawn(increase_reserved_cycles_limit()));
}

let env = init_env(data.rng_seed);
init_cycles_dispenser_client(data.cycles_dispenser_canister_id, data.test_mode);
init_state(env, data, args.wasm_version);

info!(version = %args.wasm_version, "Post-upgrade complete");
}

async fn increase_reserved_cycles_limit() {
ic_cdk::api::management_canister::main::update_settings(UpdateSettingsArgument {
canister_id: CanisterId::from_text("ow6el-gyaaa-aaaar-av5na-cai").unwrap(),
settings: CanisterSettings {
reserved_cycles_limit: Some(10_000_000_000_000u128.into()),
..Default::default()
},
})
.await
.unwrap();
}
2 changes: 2 additions & 0 deletions backend/canisters/neuron_controller/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

## [unreleased]

## [[2.0.1426](https://github.com/open-chat-labs/open-chat/releases/tag/v2.0.1426-neuron_controller)] - 2024-11-06

### Added

- Add an error log with http endpoint ([#6608](https://github.com/open-chat-labs/open-chat/pull/6608))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,10 @@ fn post_upgrade(args: Args) {
let memory = get_upgrades_memory();
let reader = get_reader(&memory);

let (data, logs, traces): (Data, Vec<LogEntry>, Vec<LogEntry>) = msgpack::deserialize(reader).unwrap();
let (data, errors, logs, traces): (Data, Vec<LogEntry>, Vec<LogEntry>, Vec<LogEntry>) =
msgpack::deserialize(reader).unwrap();

// TODO: After release change this to
// let (data, errors, logs, traces): (Data, Vec<LogEntry>, Vec<LogEntry>, Vec<LogEntry>) = 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);
Expand Down
2 changes: 1 addition & 1 deletion backend/libraries/utils/src/env/canister.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ impl Environment for CanisterEnv {
}

fn cycles_balance(&self) -> Cycles {
ic_cdk::api::canister_balance().into()
ic_cdk::api::canister_balance128()
}

fn rng(&mut self) -> &mut StdRng {
Expand Down

0 comments on commit a641a0f

Please sign in to comment.