Skip to content

Commit

Permalink
Merge branch 'main' into mraszyk/unstoppable-disaster-recovery
Browse files Browse the repository at this point in the history
  • Loading branch information
mraszyk committed Oct 22, 2024
2 parents a1aeb34 + 610e8eb commit 27335fc
Show file tree
Hide file tree
Showing 59 changed files with 1,127 additions and 297 deletions.
220 changes: 215 additions & 5 deletions .release.json

Large diffs are not rendered by default.

16 changes: 8 additions & 8 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

35 changes: 35 additions & 0 deletions apps/wallet/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,38 @@
## 0.0.2-alpha.11 (2024-10-22)


### 🚀 Features

- **control-panel:** support deploying large station WASM ([#364](https://github.com/dfinity/orbit/pull/364))

- **control-panel:** support large WASM in registry ([#365](https://github.com/dfinity/orbit/pull/365))

- **dfx-orbit:** dfx-orbit version 0.5.0 ([#370](https://github.com/dfinity/orbit/pull/370))

- **control-panel:** allow deploying station to subnet of choice ([#372](https://github.com/dfinity/orbit/pull/372))

- **dfx-orbit:** support installing canisters with large WASM ([#380](https://github.com/dfinity/orbit/pull/380))

- **station:** add canister execution method and validation pair edit variant ([#381](https://github.com/dfinity/orbit/pull/381))

- **station:** allow external canister creation on subnet of choice ([#383](https://github.com/dfinity/orbit/pull/383))

- **wallet:** add external canister method call ui ([#385](https://github.com/dfinity/orbit/pull/385))

- **station:** init with default external canisters policies ([#393](https://github.com/dfinity/orbit/pull/393))


### 🩹 Fixes

- **release:** workaround nx bug in release script ([#375](https://github.com/dfinity/orbit/pull/375))


### ❤️ Thank You

- Kepler Vital
- Leon Tan
- mraszyk @mraszyk

## 0.0.2-alpha.10 (2024-10-02)


Expand Down
2 changes: 1 addition & 1 deletion apps/wallet/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "wallet-dapp",
"private": true,
"version": "0.0.2-alpha.10",
"version": "0.0.2-alpha.11",
"type": "module",
"repository": {
"type": "git",
Expand Down
9 changes: 7 additions & 2 deletions apps/wallet/public/compat.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
{
"__important__": "This file is automatically generated by the build process. Do not modify it manually.",
"version": "0.0.2-alpha.10",
"version": "0.0.2-alpha.11",
"api": {
"latest": "0.0.2-alpha.7",
"latest": "0.0.2-alpha.8",
"compatibility": {
"0.0.2-alpha.8": {
"ui": [
"0.0.2-alpha.11"
]
},
"0.0.2-alpha.7": {
"ui": [
"0.0.2-alpha.10"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ describe('CanisterIcSettingsDialog', () => {
freezing_threshold: BigInt(0),
memory_allocation: BigInt(0),
reserved_cycles_limit: BigInt(0),
log_visibility: { controllers: null },
wasm_memory_limit: BigInt(0),
},
attach: true, // disables teleport in VDialog
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,8 @@ const initialModel = (): CanisterIcSettingsModel => {
model.reserved_cycles_limit = parseToNumberOrUndefined(
props.canisterSettings?.reserved_cycles_limit,
);
model.log_visibility = props.canisterSettings?.log_visibility;
model.wasm_memory_limit = parseToNumberOrUndefined(props.canisterSettings?.wasm_memory_limit);
return model;
};
Expand Down Expand Up @@ -167,6 +169,17 @@ const submit = async (input: CanisterIcSettingsModel) => {
BigInt(input.reserved_cycles_limit) !== props.canisterSettings?.reserved_cycles_limit
? [BigInt(input.reserved_cycles_limit)]
: [],
wasm_memory_limit:
input.wasm_memory_limit !== undefined &&
BigInt(input.wasm_memory_limit) !== props.canisterSettings?.wasm_memory_limit
? [BigInt(input.wasm_memory_limit)]
: [],
log_visibility:
input.log_visibility &&
JSON.stringify(input.log_visibility) !==
JSON.stringify(props.canisterSettings?.log_visibility)
? [input.log_visibility]
: [],
controllers: input.controllers && hasUpdatedControllers ? [input.controllers] : [],
},
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,23 @@
]"
:hint="$t('external_canisters.native_settings.reserved_cycles_limit_hint')"
/>
<VTextField
v-model="model.wasm_memory_limit"
:label="$t('external_canisters.native_settings.wasm_memory_limit')"
name="wasm_memory_limit"
:readonly="props.readonly"
density="comfortable"
type="number"
:rules="[
requiredRule,
numberRangeRule({
min: 0,
max: Number.MAX_SAFE_INTEGER,
decimals: 0,
}),
]"
:hint="$t('external_canisters.native_settings.wasm_memory_limit_hint')"
/>
<VTextField
v-model="model.freezing_threshold"
:label="$t('external_canisters.native_settings.freezing_threshold')"
Expand All @@ -161,6 +178,17 @@
]"
:hint="$t('external_canisters.native_settings.freezing_threshold_hint')"
/>
<VSelect
v-model="model.log_visibility"
:items="logVisibilityItems"
:label="$t('external_canisters.native_settings.log_visibility')"
:hint="$t('external_canisters.native_settings.log_visibility_hint')"
name="log_visibility"
:readonly="props.readonly"
density="comfortable"
item-value="value"
item-title="text"
/>
</VCol>
</VRow>
</VContainer>
Expand All @@ -186,12 +214,14 @@ import {
import logger from '~/core/logger.core';
import { useAppStore } from '~/stores/app.store';
import { useStationStore } from '~/stores/station.store';
import { VFormValidation } from '~/types/helper.types';
import { SelectItem, VFormValidation } from '~/types/helper.types';
import { copyToClipboard } from '~/utils/app.utils';
import { numberRangeRule, requiredRule, uniqueRule, validPrincipalRule } from '~/utils/form.utils';
import TextOverflow from '../TextOverflow.vue';
import CanisterIdField from '../inputs/CanisterIdField.vue';
import { CanisterIcSettingsModel } from './external-canisters.types';
import { LogVisibility } from '~/generated/station/station.did';
import { useI18n } from 'vue-i18n';

const props = withDefaults(
defineProps<{
Expand Down Expand Up @@ -220,6 +250,7 @@ const emit = defineEmits<{

const form = ref<VFormValidation>();
const valid = ref(true);
const i18n = useI18n();
const fieldsWithErrors = ref<string[]>([]);
const newController = ref<string>('');
const app = useAppStore();
Expand All @@ -233,6 +264,8 @@ const takeModelSnapshot = (model: CanisterIcSettingsModel): string => {
snapshot.set('reserved_cycles_limit', model.reserved_cycles_limit?.toString());
snapshot.set('freezing_threshold', model.freezing_threshold?.toString());
snapshot.set('canister_id', model.canisterId?.toText());
snapshot.set('wasm_memory_limit', model.wasm_memory_limit?.toString());
snapshot.set('log_visibility', JSON.stringify(model.log_visibility));

const controllers = model.controllers?.map(c => c.toText()).sort() ?? [];
controllers.forEach((controller, idx) => snapshot.set(`controllers[${idx}]`, controller));
Expand Down Expand Up @@ -333,6 +366,11 @@ const addController = () => {
newController.value = '';
};

const logVisibilityItems = computed<SelectItem<LogVisibility>[]>(() => [
{ value: { controllers: null }, text: i18n.t('terms.controllers') },
{ value: { public: null }, text: i18n.t('terms.public') },
]);

const existingControllers = computed(() => model.value.controllers?.map(c => c.toText()) || []);

const revalidate = async (): Promise<boolean> => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import {
CanisterInstallMode,
CanisterMethod,
ExternalCanisterChangeRequestPolicyRuleInput,
LogVisibility,
ValidationMethodResourceTarget,
} from '~/generated/station/station.did';

Expand All @@ -19,6 +20,8 @@ export interface CanisterIcSettingsModel {
memory_allocation?: number;
compute_allocation?: number;
reserved_cycles_limit?: number;
log_visibility?: LogVisibility;
wasm_memory_limit?: number;
}

export interface CanisterInstallModel {
Expand Down
10 changes: 10 additions & 0 deletions apps/wallet/src/configs/permissions.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -345,6 +345,16 @@ export const globalPermissions = (): AggregatedResoucePermissions[] => [
allow: defaultAllowLevels(),
canEdit: false,
},
{
action: ResourceActionEnum.CallCanister,
resource: {
ExternalCanister: {
Call: { execution_method: { Any: null }, validation_method: { No: null } },
},
},
allow: defaultAllowLevels(),
canEdit: false,
},
],
match(specifier: Resource, resource: Resource): boolean {
if (variantIs(specifier, 'ExternalCanister') && variantIs(resource, 'ExternalCanister')) {
Expand Down
4 changes: 2 additions & 2 deletions apps/wallet/src/generated/control-panel/control_panel.did
Original file line number Diff line number Diff line change
Expand Up @@ -265,8 +265,8 @@ type CanDeployStationResult = variant {
type WasmModuleExtraChunks = record {
// The asset canister from which the chunks are to be retrieved.
store_canister : principal;
// The list of chunk hashes in the order they should be appended to the wasm module.
chunk_hashes_list : vec blob;
// The name of the asset containing extra chunks in the asset canister.
extra_chunks_key : text;
// The hash of the assembled wasm module.
wasm_module_hash : blob;
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -206,8 +206,8 @@ export type UserSubscriptionStatus = { 'Unsubscribed' : null } |
{ 'Pending' : null };
export interface WasmModuleExtraChunks {
'wasm_module_hash' : Uint8Array | number[],
'chunk_hashes_list' : Array<Uint8Array | number[]>,
'store_canister' : Principal,
'extra_chunks_key' : string,
}
export interface WasmModuleRegistryEntryDependency {
'name' : string,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
export const idlFactory = ({ IDL }) => {
const WasmModuleExtraChunks = IDL.Record({
'wasm_module_hash' : IDL.Vec(IDL.Nat8),
'chunk_hashes_list' : IDL.Vec(IDL.Vec(IDL.Nat8)),
'store_canister' : IDL.Principal,
'extra_chunks_key' : IDL.Text,
});
const WasmModuleRegistryEntryDependency = IDL.Record({
'name' : IDL.Text,
Expand Down
4 changes: 2 additions & 2 deletions apps/wallet/src/generated/station/station.did
Original file line number Diff line number Diff line change
Expand Up @@ -558,8 +558,8 @@ type SystemUpgradeTarget = variant {
type WasmModuleExtraChunks = record {
// The asset canister from which the chunks are to be retrieved.
store_canister : principal;
// The list of chunk hashes in the order they should be appended to the wasm module.
chunk_hashes_list : vec blob;
// The name of the asset containing extra chunks in the asset canister.
extra_chunks_key : text;
// The hash of the assembled wasm module.
wasm_module_hash : blob;
};
Expand Down
2 changes: 1 addition & 1 deletion apps/wallet/src/generated/station/station.did.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1245,8 +1245,8 @@ export type ValidationMethodResourceTarget = { 'No' : null } |
{ 'ValidationMethod' : CanisterMethod };
export interface WasmModuleExtraChunks {
'wasm_module_hash' : Uint8Array | number[],
'chunk_hashes_list' : Array<Uint8Array | number[]>,
'store_canister' : Principal,
'extra_chunks_key' : string,
}
export interface _SERVICE {
'canister_status' : ActorMethod<[CanisterStatusInput], CanisterStatusResult>,
Expand Down
2 changes: 1 addition & 1 deletion apps/wallet/src/generated/station/station.did.js
Original file line number Diff line number Diff line change
Expand Up @@ -324,8 +324,8 @@ export const idlFactory = ({ IDL }) => {
});
const WasmModuleExtraChunks = IDL.Record({
'wasm_module_hash' : IDL.Vec(IDL.Nat8),
'chunk_hashes_list' : IDL.Vec(IDL.Vec(IDL.Nat8)),
'store_canister' : IDL.Principal,
'extra_chunks_key' : IDL.Text,
});
const CanisterInstallMode = IDL.Variant({
'reinstall' : IDL.Null,
Expand Down
7 changes: 7 additions & 0 deletions apps/wallet/src/locales/en.locale.ts
Original file line number Diff line number Diff line change
Expand Up @@ -529,6 +529,10 @@ export default {
reserved_cycles_limit: 'Reserved Cycles Limit',
reserved_cycles_limit_hint:
'Number of cycles the canister can allocate, operations that allocate memory or compute will fail if the limit is reached.',
wasm_memory_limit: 'Wasm Memory Limit',
wasm_memory_limit_hint: 'The maximum amount of memory the canister can use for Wasm heap.',
log_visibility: 'Log Visibility',
log_visibility_hint: 'The visibility of the canister logs.',
},
wasm_module: 'WASM Module',
wasm_args: 'Arguments',
Expand All @@ -545,6 +549,8 @@ export default {
},
},
terms: {
controllers: 'Controllers',
public: 'Public',
execute: 'Execute',
error: 'Error',
self: 'Self',
Expand Down Expand Up @@ -928,6 +934,7 @@ export default {
systemupgrade: 'Upgrade',
change: 'Change',
fund: 'Fund',
callcanister: 'Call',
},
allow: {
public: 'Anyone',
Expand Down
Loading

0 comments on commit 27335fc

Please sign in to comment.