Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(station)!: migrate to new model #408

Merged
merged 24 commits into from
Oct 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
b3ddf30
migration unit tests
olaszakos Oct 26, 2024
5616c80
migrate requests
olaszakos Oct 26, 2024
ee00b92
fix cargo migration test
olaszakos Oct 28, 2024
4236be8
pass migration integration tests
olaszakos Oct 28, 2024
d15aaf7
clean up migrations; add repo snapshot generation
olaszakos Oct 29, 2024
ce7eda9
upgrader retains legacy account sync support
olaszakos Oct 30, 2024
fc11442
fix DR tests
olaszakos Oct 30, 2024
8c9695b
add test for legacy spec support
olaszakos Oct 30, 2024
2aa4d7c
add test for backwards compatibility
olaszakos Oct 30, 2024
15c68ba
Merge branch 'multi-chain-support' into PEN-309-migrate-to-new-model
olaszakos Oct 31, 2024
91c7a27
fix lint
olaszakos Oct 31, 2024
81895bd
Update core/upgrader/api/spec.did
olaszakos Oct 31, 2024
20e69a5
Update core/upgrader/api/spec.did
olaszakos Oct 31, 2024
ada3cdb
Update core/upgrader/impl/src/services/disaster_recovery.rs
olaszakos Oct 31, 2024
6a3a433
Update tests/integration/src/migration_tests.rs
olaszakos Oct 31, 2024
79f3997
Merge branch 'PEN-309-migrate-to-new-model' of github.com:dfinity/orb…
olaszakos Oct 31, 2024
24ca483
Update core/upgrader/api/spec.did
olaszakos Oct 31, 2024
07874b5
rebuild repositories in migration
olaszakos Oct 31, 2024
e42ac06
call InternetComputer::create() once
olaszakos Oct 31, 2024
9c03c84
cleanup: remove else branches
olaszakos Oct 31, 2024
46f700b
run cargo fmt
olaszakos Oct 31, 2024
8b58f60
Merge branch 'PEN-309-migrate-to-new-model' of github.com:dfinity/orb…
olaszakos Oct 31, 2024
d779750
clean up in-progress check
olaszakos Oct 31, 2024
f3b9454
some more cleanup
olaszakos Oct 31, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion apps/wallet/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,4 @@
"vite-plugin-vuetify": "2.0.4",
"vite-plugin-wasm": "3.3.0"
}
}
}
6 changes: 4 additions & 2 deletions core/station/impl/src/controllers/system.rs
Original file line number Diff line number Diff line change
Expand Up @@ -168,9 +168,11 @@ mod tests {

#[tokio::test]
async fn apply_migration_should_migrate_stable_memory_version() {
let base_stable_memory_version = STABLE_MEMORY_VERSION - 1;

let mut system_info = SystemInfo::new(Principal::management_canister(), Vec::new());

system_info.set_stable_memory_version(0);
system_info.set_stable_memory_version(base_stable_memory_version);

write_system_info(system_info);

Expand All @@ -191,7 +193,7 @@ mod tests {

REQUEST_REPOSITORY.insert(request.to_key(), request.clone());

system_info.set_stable_memory_version(0);
system_info.set_stable_memory_version(base_stable_memory_version);
system_info.set_change_canister_request(request.id);

write_system_info(system_info);
Expand Down
18 changes: 3 additions & 15 deletions core/station/impl/src/core/init.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,9 @@ use crate::models::{
request_policy_rule::RequestPolicyRule,
request_specifier::{RequestSpecifier, ResourceSpecifier, UserSpecifier},
resource::{
AccountResourceAction, CallExternalCanisterResourceTarget, ExecutionMethodResourceTarget,
ExternalCanisterId, ExternalCanisterResourceAction, PermissionResourceAction,
RequestResourceAction, Resource, ResourceAction, ResourceId, ResourceIds,
SystemResourceAction, UserResourceAction, ValidationMethodResourceTarget,
AccountResourceAction, ExternalCanisterId, ExternalCanisterResourceAction,
PermissionResourceAction, RequestResourceAction, Resource, ResourceAction, ResourceId,
ResourceIds, SystemResourceAction, UserResourceAction,
},
ADMIN_GROUP_ID,
};
Expand Down Expand Up @@ -166,17 +165,6 @@ lazy_static! {
Allow::user_groups(vec![*ADMIN_GROUP_ID]),
Resource::ExternalCanister(ExternalCanisterResourceAction::Fund(ExternalCanisterId::Any)),
),
(
Allow::user_groups(vec![*ADMIN_GROUP_ID]),
Resource::ExternalCanister(ExternalCanisterResourceAction::Call(CallExternalCanisterResourceTarget {
validation_method: ValidationMethodResourceTarget::No,
execution_method: ExecutionMethodResourceTarget::Any,
})),
),
(
Allow::user_groups(vec![*ADMIN_GROUP_ID]),
Resource::ExternalCanister(ExternalCanisterResourceAction::Read(ExternalCanisterId::Any)),
keplervital marked this conversation as resolved.
Show resolved Hide resolved
),
// assets
(
Allow::user_groups(vec![*ADMIN_GROUP_ID]),
Expand Down
2 changes: 1 addition & 1 deletion core/station/impl/src/core/memory.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ thread_local! {

// The memory manager is used for simulating multiple memories. Given a `MemoryId` it can
// return a memory that can be used by stable structures.
static MEMORY_MANAGER: RefCell<MemoryManager<Memory>> =
pub static MEMORY_MANAGER: RefCell<MemoryManager<Memory>> =
RefCell::new(MemoryManager::init_with_bucket_size(managed_memory(), STABLE_MEMORY_BUCKET_SIZE));
}

Expand Down
1 change: 1 addition & 0 deletions core/station/impl/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ pub mod jobs;
mod macros;
pub mod mappers;
pub mod migration;
pub mod migration_tests;
pub mod models;
pub mod repositories;
pub mod services;
Loading
Loading