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

UB when copying strings to WASM. #3801

Closed
khoover opened this issue Jan 21, 2024 · 3 comments · Fixed by #3808
Closed

UB when copying strings to WASM. #3801

khoover opened this issue Jan 21, 2024 · 3 comments · Fixed by #3808
Labels

Comments

@khoover
Copy link

khoover commented Jan 21, 2024

Describe the Bug

When converting a JS string into a Rust string via JsString::into, dropping the produced String generates a layout that violates the dealloc contract.

Steps to Reproduce

  1. Checkout https://github.com/khoover/base32768-rs/tree/talc-error
  2. From base32768-rs/examples/js-bench, run
RUSTFLAGS="-C target-cpu=mvp" wasm-pack build --debug --target nodejs
node bench-runner.js
  1. See error

Expected Behavior

Some benchmark timings being emitted to console.

Actual Behavior

A RuntimeError crashes node while the benchmarks are running.

khoover@DESKTOP-CUT25MA:~/base32768-rs/examples/js-bench$ node pkg/bench-runner.js 
Took 7 ms to load and init bench wasm
wasm://wasm/00189ade:1


RuntimeError: unreachable
    at __rust_start_panic (wasm://wasm/00189ade:wasm-function[1201]:0x449d6)
    at rust_panic (wasm://wasm/00189ade:wasm-function[1173]:0x44891)
    at std::panicking::rust_panic_with_hook::hc20eadded6bfe687 (wasm://wasm/00189ade:wasm-function[363]:0x32839)
    at std::panicking::begin_panic_handler::{{closure}}::h82415fe35b0e2001 (wasm://wasm/00189ade:wasm-function[443]:0x36681)
    at std::sys_common::backtrace::__rust_end_short_backtrace::h71f504d46a203d88 (wasm://wasm/00189ade:wasm-function[1196]:0x449b3)
    at rust_begin_unwind (wasm://wasm/00189ade:wasm-function[708]:0x3e2fa)
    at core::panicking::panic_fmt::h7a368385936888dc (wasm://wasm/00189ade:wasm-function[947]:0x425b9)
    at core::panicking::panic::h7bbea3773b752235 (wasm://wasm/00189ade:wasm-function[859]:0x41116)
    at talc::Talc<O>::free::h14aa50d45611ce00 (wasm://wasm/00189ade:wasm-function[81]:0x1a142)
    at <talc::talck::Talck<R,O> as core::alloc::global::GlobalAlloc>::dealloc::hcf08400e756d2221 (wasm://wasm/00189ade:wasm-function[496]:0x386e4)

Additional Context

Initially reported as an allocator bug in SFBdragon/talc#24. After investigation, seems like the allocator is being passed a different layout than the most recent alloc for the given pointer; std doesn't catch because it ignores layout information for wasm32-unknown-unknown.

Also of note: the Box<[u16]> produced by the encode function can contain unpaired surrogates and other potentially invalid BMP codepoints. If we comment out the function that tries to do a round trip on these unpaired surrogate-containing sequences, the program stops crashing even with Talck as the allocator.

This triggers UB for when using, e.g., let s: String = js_string.into(); on any JS string that contains non-ASCII codepoints, where at least one requires 2 or 4 UTF-8 bytes to encode.

@khoover khoover added the bug label Jan 21, 2024
@khoover
Copy link
Author

khoover commented Jan 21, 2024

I believe the issue comes from VectorFromWasmAbi::vector_from_abi, where it assumes that the passed-in slice has a backing allocation that is equal in size to the slice length. But the generated JS glue for passStringToWasm0 does a conservative realloc to the worst-case string length, and then only returns the number of bytes that were actually written to. So then when Vec goes to drop that allocation, it has the wrong capacity and passes a too-small size for the Layout.

Quick fix to stop the UB would be adding a 2nd realloc to reduce the allocation size down to the exact length. Actual fix would be making passStringToWasm0 have both a WASM_VECTOR_CAPACITY alongside WASM_VECTOR_LEN, so the backing Vec can be constructed with the right values. (I think this is the only place where len != capacity when passing a Vec from JS to WASM.)

@khoover khoover changed the title Potential UB when copying strings to WASM. UB when copying strings to WASM. Jan 21, 2024
@daxpedda
Copy link
Collaborator

Cc @Liamolucko.

Liamolucko added a commit to Liamolucko/wasm-bindgen that referenced this issue Jan 22, 2024
…hem to Rust

Fixes rustwasm#3801.

I opted to solve it this way rather than just pass the capacity to Rust
as well because it means the allocation isn't up to 3x bigger than it
needs to be anymore. I also removed a TODO about fixing that.
@Liamolucko
Copy link
Collaborator

I've written a fix in #3808.

Liamolucko added a commit to Liamolucko/wasm-bindgen that referenced this issue Jan 23, 2024
…hem to Rust

Fixes rustwasm#3801.

I opted to solve it this way rather than just pass the capacity to Rust
as well because it means the allocation isn't up to 3x bigger than it
needs to be anymore. I also removed a TODO about fixing that.
Liamolucko added a commit that referenced this issue Jan 25, 2024
…hem to Rust (#3808)

* Shrink JS-allocated strings down to the correct size before passing them to Rust

Fixes #3801.

I opted to solve it this way rather than just pass the capacity to Rust
as well because it means the allocation isn't up to 3x bigger than it
needs to be anymore. I also removed a TODO about fixing that.

* Update reference tests

* Add changelog entry
github-merge-queue bot pushed a commit to dfinity/nns-dapp that referenced this issue May 23, 2024
# Motivation

There is a bug in Rust 1.78:
rustwasm/wasm-bindgen#3801
I'm not sure if it affects us but better safe than sorry.

# Changes

Go back to the version of Rust (1.77.2) we were using before
#4822

# Tests

CI

# Todos

- [x] Add entry to changelog (if necessary).
mstrasinskis added a commit to dfinity/nns-dapp that referenced this issue May 23, 2024
commit 87df248
Author: David de Kloet <122978264+dskloetd@users.noreply.github.com>
Date:   Thu May 23 15:15:07 2024 +0200

    Downgrade rust from 1.78 to 1.77 (#4910)

    # Motivation

    There is a bug in Rust 1.78:
    rustwasm/wasm-bindgen#3801
    I'm not sure if it affects us but better safe than sorry.

    # Changes

    Go back to the version of Rust (1.77.2) we were using before
    #4822

    # Tests

    CI

    # Todos

    - [x] Add entry to changelog (if necessary).

commit 4b8179b
Author: David de Kloet <122978264+dskloetd@users.noreply.github.com>
Date:   Thu May 23 14:33:42 2024 +0200

    Extract cell components from TokensTableRow (#4909)

    # Motivation

    We want to try to reuse the tokens table structure and style for the
    neurons table.
    The `TokensTable` component is currently very specific to the tokens
    table.
    By extracting tokens specific subcomponents, I'm hoping to separate the
    generic table structure from the tokens specific rendering.
    And this should make it easier to subsequently create a generic table
    component and use that for both the tokens table and the neurons table.

    # Changes

    1. Create `TokenTitleCell`, `TokenBalanceCell` and `TokenActionsCell`
    component.
    2. Use those components in `TokensTableRow.svelte`

    # Tests

    All tokens table functionality continues to be covered by
    `src/tests/lib/components/tokens/TokensTable.spec.ts`.

    # Todos

    - [ ] Add entry to changelog (if necessary).
    not necessary

commit aeaaf8b
Author: David de Kloet <122978264+dskloetd@users.noreply.github.com>
Date:   Thu May 23 13:23:31 2024 +0200

    Remove existing environment in env-vars.utils.spec.ts (#4908)

    # Motivation

    Unit tests can depend on environment variables set in `frontend/.env`
    which can be different depending on how `./config.sh` is run.
    In `frontend/src/tests/lib/utils/env-vars.utils.spec.ts` we stub out
    environment variables that we expect to read, but additional environment
    variables could potentially affect the test as well.

    Currently, the following
    ```
    DFX_NETWORK=mainnet ./config.sh
    npm run test -- env-vars
    ```
    fails with
    ```
     FAIL  src/tests/lib/utils/env-vars.utils.spec.ts > env-vars-utils > TVL canister ID is not mandatory
    AssertionError: expected { …(20) } to deeply equal { …(18) }

    - Expected
    + Received

      Object {
        "ckbtcIndexCanisterId": "olzyh-buaaa-aaaaa-qabga-cai",
        "ckbtcLedgerCanisterId": "oz7p6-neaaa-aaaaa-qabfa-cai",
        "ckbtcMinterCanisterId": "o66jk-a4aaa-aaaaa-qabfq-cai",
        "ckethIndexCanisterId": "of3vp-2eaaa-aaaaa-qabha-cai",
        "ckethLedgerCanisterId": "omy6t-mmaaa-aaaaa-qabgq-cai",
    +   "ckusdcIndexCanisterId": "xrs4b-hiaaa-aaaar-qafoa-cai",
    +   "ckusdcLedgerCanisterId": "xevnm-gaaaa-aaaar-qafnq-cai",
        "cyclesMintingCanisterId": "rkp4c-7iaaa-aaaaa-aaaca-cai",
        "dfxNetwork": "local",
        "featureFlags": "{\"ENABLE_CKBTC\":true,\"ENABLE_CKTESTBTC\":false,\"ENABLE_SNS\":true,\"ENABLE_SNS_2\":true,\"ENABLE_VOTING_INDICATION\":false}",
        "fetchRootKey": "true",
        "governanceCanisterId": "rrkah-fqaaa-aaaaa-aaaaq-cai",
        "host": "http://localhost:8080",
        "identityServiceUrl": "http://qhbym-qaaaa-aaaaa-aaafq-cai.localhost:8080",
        "indexCanisterId": "mecbw-6maaa-aaaaa-qabkq-cai",
        "ledgerCanisterId": "ryjl3-tyaaa-aaaaa-aaaba-cai",
        "ownCanisterId": "qsgjb-riaaa-aaaaa-aaaga-cai",
        "snsAggregatorUrl": "http://bd3sg-teaaa-aaaaa-qaaba-cai.localhost:8080",
        "tvlCanisterId": undefined,
        "wasmCanisterId": "qaa6y-5yaaa-aaaaa-aaafa-cai",
      }

     ❯ src/tests/lib/utils/env-vars.utils.spec.ts:116:26
        114|   it("TVL canister ID is not mandatory", () => {
        115|     vi.stubEnv("VITE_TVL_CANISTER_ID", "");
        116|     expect(getEnvVars()).toEqual({
           |                          ^
        117|       ...defaultExpectedEnvVars,
        118|       tvlCanisterId: undefined,

    ⎯⎯⎯⎯
    ```

    # Changes

    In `frontend/src/tests/lib/utils/env-vars.utils.spec.ts` unset all
    existing environment variables before stubbing a specific set of
    variables.

    # Tests

    Ran
    ```
    DFX_NETWORK=mainnet ./config.sh
    npm run test -- env-vars
    ```
    which fails before this change and passes after.

    # Todos

    - [ ] Add entry to changelog (if necessary).
    not necessary

commit b4daed2
Author: Max Strasinsky <98811342+mstrasinskis@users.noreply.github.com>
Date:   Thu May 23 09:35:42 2024 +0200

    Snses without actionables banner (#4902)

    # Motivation

    Because not all projects support actionable proposals (return neuron
    ballots), not all actionable proposals will be shown on the actionable
    proposals page. To make it clear that there could be more votable
    proposals, we display a banner with a list of projects that do not have
    actionable support. In this PR, we create a banner component that will
    be shown on the actionable proposals page.

    # Changes

    - Add new component `ActionableProposalsNotSupportedSnses`

    # Tests

    - PO for `ActionableProposalsNotSupportedSnses`
    - Tests for `ActionableProposalsNotSupportedSnses`

    # Todos

    - [ ] Add entry to changelog (if necessary).
    not yet.

    # Screenshot

    <img width="1325" alt="image"
    src="https://github.com/dfinity/nns-dapp/assets/98811342/ab1fbcf6-0f6e-4a8f-ac69-cb79fe990808">

commit 37633d0
Author: sa-github-api <138766536+sa-github-api@users.noreply.github.com>
Date:   Thu May 23 08:37:07 2024 +0200

    Update SNS Aggregator Response (#4906)

    # Motivation
    We would like to keep the ProdLaunchpad.spec up to date with mainnet
    data.

    # Changes
    * Update the files used for the fetch mock in ProdLaunchpad.spec.

    # Tests
    Only test changes.

    Co-authored-by: gix-bot <gix-bot@users.noreply.github.com>

commit e25ade4
Author: David de Kloet <122978264+dskloetd@users.noreply.github.com>
Date:   Wed May 22 17:35:52 2024 +0200

    Remove outdated comment (#4904)

    # Motivation

    In the `TokensTableRow` component there is a comment explaining why we
    duplicate the actions.
    But we don't actually duplicate the actions so this comment shouldn't be
    there.

    # Changes

    Remove the comment.

    # Tests

    I checked with @lmuntaner who added it.

    # Todos

    - [ ] Add entry to changelog (if necessary).
    not necessary

commit 943ed15
Author: David de Kloet <122978264+dskloetd@users.noreply.github.com>
Date:   Wed May 22 12:47:52 2024 +0200

    Set mainnet ckUSDC canister IDs (#4903)

    # Motivation

    We need the canister IDs to support ckUSDC in NNS dapp.

    I got these canister IDs from:
    ```
    $ dfx canister --network ic call vxkom-oyaaa-aaaar-qafda-cai get_orchestrator_info
    (
      record {
        cycles_management = record {
          cycles_top_up_increment = 10_000_000_000_000 : nat;
          cycles_for_ledger_creation = 150_000_000_000_000 : nat;
          cycles_for_archive_creation = 50_000_000_000_000 : nat;
          cycles_for_index_creation = 100_000_000_000_000 : nat;
        };
        managed_canisters = vec {
          record {
            erc20_contract = record {
              chain_id = 1 : nat;
              address = "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48";
            };
            ledger = opt variant {
              Installed = record {
                canister_id = principal "xevnm-gaaaa-aaaar-qafnq-cai";
                installed_wasm_hash = "4ca82938d223c77909dcf594a49ea72c07fd513726cfa7a367dd0be0d6abc679";
              }
            };
            index = opt variant {
              Installed = record {
                canister_id = principal "xrs4b-hiaaa-aaaar-qafoa-cai";
                installed_wasm_hash = "55dd5ea22b65adf877cea893765561ae290b52e7fdfdc043b5c18ffbaaa78f33";
              }
            };
            archives = vec {};
            ckerc20_token_symbol = "ckUSDC";
          };
        };
        more_controller_ids = vec { principal "r7inp-6aaaa-aaaaa-aaabq-cai" };
        minter_id = opt principal "sv3dd-oaaaa-aaaar-qacoa-cai";
      },
    )
    ```

    # Changes

    1. Add `ckusdc_ledger` and `ckusdc_index` canister IDs for `mainnet` and
    `app` networks.
    2. Ran `scripts/nns-dapp/test-config --update`.

    # Tests

    Deployed with
    https://github.com/dfinity/nns-dapp/actions/workflows/deploy-to-app.yaml
    for testing.

    # Todos

    - [ ] Add entry to changelog (if necessary).
    covered by existing entry

commit 0b71a2c
Author: Max Strasinsky <98811342+mstrasinskis@users.noreply.github.com>
Date:   Wed May 22 09:11:39 2024 +0200

    Select universe card all actionable mode (#4901)

    # Motivation

    For select "all actionable proposals" we need to have a universe card
    with the "Vote" icon and static text. To maintain the original universe
    card’s styles and functionality, we extended the existing
    SelectUniverseCard component rather than creating a new one.

    # Changes

    - Extend `SelectUniverseCard` to display a "Actionable proposals" card.

    # Tests

    - Extended.

    <img width="273" alt="image"
    src="https://github.com/dfinity/nns-dapp/assets/98811342/11e4e564-9e47-4c39-8e2f-f4e35b2be067">

    # Todos

    - [ ] Add entry to changelog (if necessary).
    Not yet.

commit ed2f186
Author: David de Kloet <122978264+dskloetd@users.noreply.github.com>
Date:   Tue May 21 19:40:38 2024 +0200

    NNS1-2905: Remove transactions fields from accounts (step 2) (#4836)

    This PR should only be merged after we have a release on mainnet
    containing #4800.

    The commit currently on mainnet:
    ```
    $ dfx canister metadata nns-dapp git_commit_id --network mainnet
    581eb32
    ```
    That
    [commit](581eb32)
    is from May 15th, well after PR #4800, which was merged May 10th.

    # Motivation

    This is the follow-up to #4800.
    In the previous PR we removed the transactions fields but still encoded
    to stable memory including the fields.
    In this PR we stop encoding the old fields completely.
    There will still be accounts in stable memory with the fields but they
    will be ignored when reading and removed when writing.
    We have not yet decided if we also want to do a migration round to
    remove all the fields from stable memory.

    # Changes

    1. Stop converting `Account` to `OldAccount` before encoding it to
    stable memory.

    # Tests

    1. `upgrade-downgrade-test` passed.
    2. Manually tested upgrading and downgrading while creating new
    subaccounts before, in between and after.

    # Todos

    - [x] Add entry to changelog (if necessary).

commit 7a9f74e
Author: Max Strasinsky <98811342+mstrasinskis@users.noreply.github.com>
Date:   Tue May 21 17:31:10 2024 +0200

    Upgrade gix components (#4898)

    # Motivation

    For the actionable page menu entry, we need an updated `Vote` icon with
    size prop support.

    # Changes

    - `npm run update:gix`

    # Tests

    Tests work.

    # Todos

    - [ ] Add entry to changelog (if necessary).
    Not necessary.

commit 9138118
Author: David de Kloet <122978264+dskloetd@users.noreply.github.com>
Date:   Tue May 21 16:26:25 2024 +0200

    Prevent installing a second snapshot before the previous one is restored (#4900)

    # Motivation

    When installing a snapshot, some files and directories are replaced with
    ones from the snapshot and the originals are placed in a backup
    directory.
    If you try to install a snapshot again, things can get confusing easily.
    Better to always restore the previous backup before installing the next.

    # Changes

    In `scripts/dfx-snapshot-install`, check if there is a directory with a
    name following the standard state backup directory name pattern. If
    there is, refuse to install the snapshot.

    # Tests

    Manually created a directory named `dfx-state-backup-123` and then tried
    to run a snapshot. Got:
    ```
    $ scripts/dfx-snapshot-start -s /Users/dskloet/snapshots/2024-05-16-ckUSDC.tar.xz
    drwxr-xr-x  2 dskloet  staff  64 May 21 15:12 /Users/dskloet/dfx-state-backup-123
    ERROR: Found existing backup directory. Restore the previous backup before installing a new snapshot.
    sh: /Users/dskloet/dfx-state-backup-20240521_152046/restore.sh: No such file or directory
    ```

    # Todos

    - [ ] Add entry to changelog (if necessary).
    not necessary

commit ead5b23
Author: David de Kloet <122978264+dskloetd@users.noreply.github.com>
Date:   Tue May 21 16:12:50 2024 +0200

    Keep existing identities when installing snapshot (#4899)

    # Motivation

    When installing an snsdemo snapshot, the entire `~/.config/dfx`
    directory gets replaced with the one from the snapshot.
    This includes all your identities.
    So while a snapshot is running, you can't use your normal identities.

    # Changes

    Instead of replacing the entire `~/.config/dfx` directory, replace all
    its contents (according to the snapshot), except the `identity`
    directory, then replace only those identities that exist in the
    snapshot, keeping the others.

    # Tests

    Ran a snapshot. Checked that identities were still there.

    # Todos

    - [ ] Add entry to changelog (if necessary).
mstrasinskis added a commit to dfinity/nns-dapp that referenced this issue May 24, 2024
commit 46ab6e3
Author: sa-github-api <138766536+sa-github-api@users.noreply.github.com>
Date:   Fri May 24 08:25:13 2024 +0200

    Update snsdemo to release-2024-05-22 (#4913)

    # Motivation
    We would like to keep the testing environment, provided by snsdemo, up
    to date.

    # Changes
    * Updated `snsdemo` version in `dfx.json`.
    * Ensured that the `dfx` version in `dfx.json` matches `snsdemo`.

    # Tests
    CI should pass.

    Co-authored-by: gix-bot <gix-bot@users.noreply.github.com>

commit 87df248
Author: David de Kloet <122978264+dskloetd@users.noreply.github.com>
Date:   Thu May 23 15:15:07 2024 +0200

    Downgrade rust from 1.78 to 1.77 (#4910)

    # Motivation

    There is a bug in Rust 1.78:
    rustwasm/wasm-bindgen#3801
    I'm not sure if it affects us but better safe than sorry.

    # Changes

    Go back to the version of Rust (1.77.2) we were using before
    #4822

    # Tests

    CI

    # Todos

    - [x] Add entry to changelog (if necessary).

commit 4b8179b
Author: David de Kloet <122978264+dskloetd@users.noreply.github.com>
Date:   Thu May 23 14:33:42 2024 +0200

    Extract cell components from TokensTableRow (#4909)

    # Motivation

    We want to try to reuse the tokens table structure and style for the
    neurons table.
    The `TokensTable` component is currently very specific to the tokens
    table.
    By extracting tokens specific subcomponents, I'm hoping to separate the
    generic table structure from the tokens specific rendering.
    And this should make it easier to subsequently create a generic table
    component and use that for both the tokens table and the neurons table.

    # Changes

    1. Create `TokenTitleCell`, `TokenBalanceCell` and `TokenActionsCell`
    component.
    2. Use those components in `TokensTableRow.svelte`

    # Tests

    All tokens table functionality continues to be covered by
    `src/tests/lib/components/tokens/TokensTable.spec.ts`.

    # Todos

    - [ ] Add entry to changelog (if necessary).
    not necessary

commit aeaaf8b
Author: David de Kloet <122978264+dskloetd@users.noreply.github.com>
Date:   Thu May 23 13:23:31 2024 +0200

    Remove existing environment in env-vars.utils.spec.ts (#4908)

    # Motivation

    Unit tests can depend on environment variables set in `frontend/.env`
    which can be different depending on how `./config.sh` is run.
    In `frontend/src/tests/lib/utils/env-vars.utils.spec.ts` we stub out
    environment variables that we expect to read, but additional environment
    variables could potentially affect the test as well.

    Currently, the following
    ```
    DFX_NETWORK=mainnet ./config.sh
    npm run test -- env-vars
    ```
    fails with
    ```
     FAIL  src/tests/lib/utils/env-vars.utils.spec.ts > env-vars-utils > TVL canister ID is not mandatory
    AssertionError: expected { …(20) } to deeply equal { …(18) }

    - Expected
    + Received

      Object {
        "ckbtcIndexCanisterId": "olzyh-buaaa-aaaaa-qabga-cai",
        "ckbtcLedgerCanisterId": "oz7p6-neaaa-aaaaa-qabfa-cai",
        "ckbtcMinterCanisterId": "o66jk-a4aaa-aaaaa-qabfq-cai",
        "ckethIndexCanisterId": "of3vp-2eaaa-aaaaa-qabha-cai",
        "ckethLedgerCanisterId": "omy6t-mmaaa-aaaaa-qabgq-cai",
    +   "ckusdcIndexCanisterId": "xrs4b-hiaaa-aaaar-qafoa-cai",
    +   "ckusdcLedgerCanisterId": "xevnm-gaaaa-aaaar-qafnq-cai",
        "cyclesMintingCanisterId": "rkp4c-7iaaa-aaaaa-aaaca-cai",
        "dfxNetwork": "local",
        "featureFlags": "{\"ENABLE_CKBTC\":true,\"ENABLE_CKTESTBTC\":false,\"ENABLE_SNS\":true,\"ENABLE_SNS_2\":true,\"ENABLE_VOTING_INDICATION\":false}",
        "fetchRootKey": "true",
        "governanceCanisterId": "rrkah-fqaaa-aaaaa-aaaaq-cai",
        "host": "http://localhost:8080",
        "identityServiceUrl": "http://qhbym-qaaaa-aaaaa-aaafq-cai.localhost:8080",
        "indexCanisterId": "mecbw-6maaa-aaaaa-qabkq-cai",
        "ledgerCanisterId": "ryjl3-tyaaa-aaaaa-aaaba-cai",
        "ownCanisterId": "qsgjb-riaaa-aaaaa-aaaga-cai",
        "snsAggregatorUrl": "http://bd3sg-teaaa-aaaaa-qaaba-cai.localhost:8080",
        "tvlCanisterId": undefined,
        "wasmCanisterId": "qaa6y-5yaaa-aaaaa-aaafa-cai",
      }

     ❯ src/tests/lib/utils/env-vars.utils.spec.ts:116:26
        114|   it("TVL canister ID is not mandatory", () => {
        115|     vi.stubEnv("VITE_TVL_CANISTER_ID", "");
        116|     expect(getEnvVars()).toEqual({
           |                          ^
        117|       ...defaultExpectedEnvVars,
        118|       tvlCanisterId: undefined,

    ⎯⎯⎯⎯
    ```

    # Changes

    In `frontend/src/tests/lib/utils/env-vars.utils.spec.ts` unset all
    existing environment variables before stubbing a specific set of
    variables.

    # Tests

    Ran
    ```
    DFX_NETWORK=mainnet ./config.sh
    npm run test -- env-vars
    ```
    which fails before this change and passes after.

    # Todos

    - [ ] Add entry to changelog (if necessary).
    not necessary

commit b4daed2
Author: Max Strasinsky <98811342+mstrasinskis@users.noreply.github.com>
Date:   Thu May 23 09:35:42 2024 +0200

    Snses without actionables banner (#4902)

    # Motivation

    Because not all projects support actionable proposals (return neuron
    ballots), not all actionable proposals will be shown on the actionable
    proposals page. To make it clear that there could be more votable
    proposals, we display a banner with a list of projects that do not have
    actionable support. In this PR, we create a banner component that will
    be shown on the actionable proposals page.

    # Changes

    - Add new component `ActionableProposalsNotSupportedSnses`

    # Tests

    - PO for `ActionableProposalsNotSupportedSnses`
    - Tests for `ActionableProposalsNotSupportedSnses`

    # Todos

    - [ ] Add entry to changelog (if necessary).
    not yet.

    # Screenshot

    <img width="1325" alt="image"
    src="https://github.com/dfinity/nns-dapp/assets/98811342/ab1fbcf6-0f6e-4a8f-ac69-cb79fe990808">

commit 37633d0
Author: sa-github-api <138766536+sa-github-api@users.noreply.github.com>
Date:   Thu May 23 08:37:07 2024 +0200

    Update SNS Aggregator Response (#4906)

    # Motivation
    We would like to keep the ProdLaunchpad.spec up to date with mainnet
    data.

    # Changes
    * Update the files used for the fetch mock in ProdLaunchpad.spec.

    # Tests
    Only test changes.

    Co-authored-by: gix-bot <gix-bot@users.noreply.github.com>

commit e25ade4
Author: David de Kloet <122978264+dskloetd@users.noreply.github.com>
Date:   Wed May 22 17:35:52 2024 +0200

    Remove outdated comment (#4904)

    # Motivation

    In the `TokensTableRow` component there is a comment explaining why we
    duplicate the actions.
    But we don't actually duplicate the actions so this comment shouldn't be
    there.

    # Changes

    Remove the comment.

    # Tests

    I checked with @lmuntaner who added it.

    # Todos

    - [ ] Add entry to changelog (if necessary).
    not necessary

commit 943ed15
Author: David de Kloet <122978264+dskloetd@users.noreply.github.com>
Date:   Wed May 22 12:47:52 2024 +0200

    Set mainnet ckUSDC canister IDs (#4903)

    # Motivation

    We need the canister IDs to support ckUSDC in NNS dapp.

    I got these canister IDs from:
    ```
    $ dfx canister --network ic call vxkom-oyaaa-aaaar-qafda-cai get_orchestrator_info
    (
      record {
        cycles_management = record {
          cycles_top_up_increment = 10_000_000_000_000 : nat;
          cycles_for_ledger_creation = 150_000_000_000_000 : nat;
          cycles_for_archive_creation = 50_000_000_000_000 : nat;
          cycles_for_index_creation = 100_000_000_000_000 : nat;
        };
        managed_canisters = vec {
          record {
            erc20_contract = record {
              chain_id = 1 : nat;
              address = "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48";
            };
            ledger = opt variant {
              Installed = record {
                canister_id = principal "xevnm-gaaaa-aaaar-qafnq-cai";
                installed_wasm_hash = "4ca82938d223c77909dcf594a49ea72c07fd513726cfa7a367dd0be0d6abc679";
              }
            };
            index = opt variant {
              Installed = record {
                canister_id = principal "xrs4b-hiaaa-aaaar-qafoa-cai";
                installed_wasm_hash = "55dd5ea22b65adf877cea893765561ae290b52e7fdfdc043b5c18ffbaaa78f33";
              }
            };
            archives = vec {};
            ckerc20_token_symbol = "ckUSDC";
          };
        };
        more_controller_ids = vec { principal "r7inp-6aaaa-aaaaa-aaabq-cai" };
        minter_id = opt principal "sv3dd-oaaaa-aaaar-qacoa-cai";
      },
    )
    ```

    # Changes

    1. Add `ckusdc_ledger` and `ckusdc_index` canister IDs for `mainnet` and
    `app` networks.
    2. Ran `scripts/nns-dapp/test-config --update`.

    # Tests

    Deployed with
    https://github.com/dfinity/nns-dapp/actions/workflows/deploy-to-app.yaml
    for testing.

    # Todos

    - [ ] Add entry to changelog (if necessary).
    covered by existing entry

commit 0b71a2c
Author: Max Strasinsky <98811342+mstrasinskis@users.noreply.github.com>
Date:   Wed May 22 09:11:39 2024 +0200

    Select universe card all actionable mode (#4901)

    # Motivation

    For select "all actionable proposals" we need to have a universe card
    with the "Vote" icon and static text. To maintain the original universe
    card’s styles and functionality, we extended the existing
    SelectUniverseCard component rather than creating a new one.

    # Changes

    - Extend `SelectUniverseCard` to display a "Actionable proposals" card.

    # Tests

    - Extended.

    <img width="273" alt="image"
    src="https://github.com/dfinity/nns-dapp/assets/98811342/11e4e564-9e47-4c39-8e2f-f4e35b2be067">

    # Todos

    - [ ] Add entry to changelog (if necessary).
    Not yet.

commit ed2f186
Author: David de Kloet <122978264+dskloetd@users.noreply.github.com>
Date:   Tue May 21 19:40:38 2024 +0200

    NNS1-2905: Remove transactions fields from accounts (step 2) (#4836)

    This PR should only be merged after we have a release on mainnet
    containing #4800.

    The commit currently on mainnet:
    ```
    $ dfx canister metadata nns-dapp git_commit_id --network mainnet
    581eb32
    ```
    That
    [commit](581eb32)
    is from May 15th, well after PR #4800, which was merged May 10th.

    # Motivation

    This is the follow-up to #4800.
    In the previous PR we removed the transactions fields but still encoded
    to stable memory including the fields.
    In this PR we stop encoding the old fields completely.
    There will still be accounts in stable memory with the fields but they
    will be ignored when reading and removed when writing.
    We have not yet decided if we also want to do a migration round to
    remove all the fields from stable memory.

    # Changes

    1. Stop converting `Account` to `OldAccount` before encoding it to
    stable memory.

    # Tests

    1. `upgrade-downgrade-test` passed.
    2. Manually tested upgrading and downgrading while creating new
    subaccounts before, in between and after.

    # Todos

    - [x] Add entry to changelog (if necessary).

commit 7a9f74e
Author: Max Strasinsky <98811342+mstrasinskis@users.noreply.github.com>
Date:   Tue May 21 17:31:10 2024 +0200

    Upgrade gix components (#4898)

    # Motivation

    For the actionable page menu entry, we need an updated `Vote` icon with
    size prop support.

    # Changes

    - `npm run update:gix`

    # Tests

    Tests work.

    # Todos

    - [ ] Add entry to changelog (if necessary).
    Not necessary.

commit 9138118
Author: David de Kloet <122978264+dskloetd@users.noreply.github.com>
Date:   Tue May 21 16:26:25 2024 +0200

    Prevent installing a second snapshot before the previous one is restored (#4900)

    # Motivation

    When installing a snapshot, some files and directories are replaced with
    ones from the snapshot and the originals are placed in a backup
    directory.
    If you try to install a snapshot again, things can get confusing easily.
    Better to always restore the previous backup before installing the next.

    # Changes

    In `scripts/dfx-snapshot-install`, check if there is a directory with a
    name following the standard state backup directory name pattern. If
    there is, refuse to install the snapshot.

    # Tests

    Manually created a directory named `dfx-state-backup-123` and then tried
    to run a snapshot. Got:
    ```
    $ scripts/dfx-snapshot-start -s /Users/dskloet/snapshots/2024-05-16-ckUSDC.tar.xz
    drwxr-xr-x  2 dskloet  staff  64 May 21 15:12 /Users/dskloet/dfx-state-backup-123
    ERROR: Found existing backup directory. Restore the previous backup before installing a new snapshot.
    sh: /Users/dskloet/dfx-state-backup-20240521_152046/restore.sh: No such file or directory
    ```

    # Todos

    - [ ] Add entry to changelog (if necessary).
    not necessary

commit ead5b23
Author: David de Kloet <122978264+dskloetd@users.noreply.github.com>
Date:   Tue May 21 16:12:50 2024 +0200

    Keep existing identities when installing snapshot (#4899)

    # Motivation

    When installing an snsdemo snapshot, the entire `~/.config/dfx`
    directory gets replaced with the one from the snapshot.
    This includes all your identities.
    So while a snapshot is running, you can't use your normal identities.

    # Changes

    Instead of replacing the entire `~/.config/dfx` directory, replace all
    its contents (according to the snapshot), except the `identity`
    directory, then replace only those identities that exist in the
    snapshot, keeping the others.

    # Tests

    Ran a snapshot. Checked that identities were still there.

    # Todos

    - [ ] Add entry to changelog (if necessary).
mstrasinskis added a commit to dfinity/nns-dapp that referenced this issue May 24, 2024
commit ec81b0a
Author: David de Kloet <122978264+dskloetd@users.noreply.github.com>
Date:   Fri May 24 09:07:52 2024 +0200

    Remove data-title from TokensTableRow (#4911)

    # Motivation

    Having an attribute on the `TokensTableRow` which is specific to the
    tokens data makes it more difficult to make the table generic so it can
    be reused for the neurons table.
    This attribute was only used for testing.

    # Changes

    1. Remove `data-title` attribute.
    2. Instead of using the `data-title` attribute to find a specific row,
    iterate over the rows and return the one that matches.
    3. Use `await` where necessary because the method now has to be async.

    # Tests

    Pass

    # Todos

    - [ ] Add entry to changelog (if necessary).
    not necessary

commit 46ab6e3
Author: sa-github-api <138766536+sa-github-api@users.noreply.github.com>
Date:   Fri May 24 08:25:13 2024 +0200

    Update snsdemo to release-2024-05-22 (#4913)

    # Motivation
    We would like to keep the testing environment, provided by snsdemo, up
    to date.

    # Changes
    * Updated `snsdemo` version in `dfx.json`.
    * Ensured that the `dfx` version in `dfx.json` matches `snsdemo`.

    # Tests
    CI should pass.

    Co-authored-by: gix-bot <gix-bot@users.noreply.github.com>

commit 87df248
Author: David de Kloet <122978264+dskloetd@users.noreply.github.com>
Date:   Thu May 23 15:15:07 2024 +0200

    Downgrade rust from 1.78 to 1.77 (#4910)

    # Motivation

    There is a bug in Rust 1.78:
    rustwasm/wasm-bindgen#3801
    I'm not sure if it affects us but better safe than sorry.

    # Changes

    Go back to the version of Rust (1.77.2) we were using before
    #4822

    # Tests

    CI

    # Todos

    - [x] Add entry to changelog (if necessary).

commit 4b8179b
Author: David de Kloet <122978264+dskloetd@users.noreply.github.com>
Date:   Thu May 23 14:33:42 2024 +0200

    Extract cell components from TokensTableRow (#4909)

    # Motivation

    We want to try to reuse the tokens table structure and style for the
    neurons table.
    The `TokensTable` component is currently very specific to the tokens
    table.
    By extracting tokens specific subcomponents, I'm hoping to separate the
    generic table structure from the tokens specific rendering.
    And this should make it easier to subsequently create a generic table
    component and use that for both the tokens table and the neurons table.

    # Changes

    1. Create `TokenTitleCell`, `TokenBalanceCell` and `TokenActionsCell`
    component.
    2. Use those components in `TokensTableRow.svelte`

    # Tests

    All tokens table functionality continues to be covered by
    `src/tests/lib/components/tokens/TokensTable.spec.ts`.

    # Todos

    - [ ] Add entry to changelog (if necessary).
    not necessary

commit aeaaf8b
Author: David de Kloet <122978264+dskloetd@users.noreply.github.com>
Date:   Thu May 23 13:23:31 2024 +0200

    Remove existing environment in env-vars.utils.spec.ts (#4908)

    # Motivation

    Unit tests can depend on environment variables set in `frontend/.env`
    which can be different depending on how `./config.sh` is run.
    In `frontend/src/tests/lib/utils/env-vars.utils.spec.ts` we stub out
    environment variables that we expect to read, but additional environment
    variables could potentially affect the test as well.

    Currently, the following
    ```
    DFX_NETWORK=mainnet ./config.sh
    npm run test -- env-vars
    ```
    fails with
    ```
     FAIL  src/tests/lib/utils/env-vars.utils.spec.ts > env-vars-utils > TVL canister ID is not mandatory
    AssertionError: expected { …(20) } to deeply equal { …(18) }

    - Expected
    + Received

      Object {
        "ckbtcIndexCanisterId": "olzyh-buaaa-aaaaa-qabga-cai",
        "ckbtcLedgerCanisterId": "oz7p6-neaaa-aaaaa-qabfa-cai",
        "ckbtcMinterCanisterId": "o66jk-a4aaa-aaaaa-qabfq-cai",
        "ckethIndexCanisterId": "of3vp-2eaaa-aaaaa-qabha-cai",
        "ckethLedgerCanisterId": "omy6t-mmaaa-aaaaa-qabgq-cai",
    +   "ckusdcIndexCanisterId": "xrs4b-hiaaa-aaaar-qafoa-cai",
    +   "ckusdcLedgerCanisterId": "xevnm-gaaaa-aaaar-qafnq-cai",
        "cyclesMintingCanisterId": "rkp4c-7iaaa-aaaaa-aaaca-cai",
        "dfxNetwork": "local",
        "featureFlags": "{\"ENABLE_CKBTC\":true,\"ENABLE_CKTESTBTC\":false,\"ENABLE_SNS\":true,\"ENABLE_SNS_2\":true,\"ENABLE_VOTING_INDICATION\":false}",
        "fetchRootKey": "true",
        "governanceCanisterId": "rrkah-fqaaa-aaaaa-aaaaq-cai",
        "host": "http://localhost:8080",
        "identityServiceUrl": "http://qhbym-qaaaa-aaaaa-aaafq-cai.localhost:8080",
        "indexCanisterId": "mecbw-6maaa-aaaaa-qabkq-cai",
        "ledgerCanisterId": "ryjl3-tyaaa-aaaaa-aaaba-cai",
        "ownCanisterId": "qsgjb-riaaa-aaaaa-aaaga-cai",
        "snsAggregatorUrl": "http://bd3sg-teaaa-aaaaa-qaaba-cai.localhost:8080",
        "tvlCanisterId": undefined,
        "wasmCanisterId": "qaa6y-5yaaa-aaaaa-aaafa-cai",
      }

     ❯ src/tests/lib/utils/env-vars.utils.spec.ts:116:26
        114|   it("TVL canister ID is not mandatory", () => {
        115|     vi.stubEnv("VITE_TVL_CANISTER_ID", "");
        116|     expect(getEnvVars()).toEqual({
           |                          ^
        117|       ...defaultExpectedEnvVars,
        118|       tvlCanisterId: undefined,

    ⎯⎯⎯⎯
    ```

    # Changes

    In `frontend/src/tests/lib/utils/env-vars.utils.spec.ts` unset all
    existing environment variables before stubbing a specific set of
    variables.

    # Tests

    Ran
    ```
    DFX_NETWORK=mainnet ./config.sh
    npm run test -- env-vars
    ```
    which fails before this change and passes after.

    # Todos

    - [ ] Add entry to changelog (if necessary).
    not necessary

commit b4daed2
Author: Max Strasinsky <98811342+mstrasinskis@users.noreply.github.com>
Date:   Thu May 23 09:35:42 2024 +0200

    Snses without actionables banner (#4902)

    # Motivation

    Because not all projects support actionable proposals (return neuron
    ballots), not all actionable proposals will be shown on the actionable
    proposals page. To make it clear that there could be more votable
    proposals, we display a banner with a list of projects that do not have
    actionable support. In this PR, we create a banner component that will
    be shown on the actionable proposals page.

    # Changes

    - Add new component `ActionableProposalsNotSupportedSnses`

    # Tests

    - PO for `ActionableProposalsNotSupportedSnses`
    - Tests for `ActionableProposalsNotSupportedSnses`

    # Todos

    - [ ] Add entry to changelog (if necessary).
    not yet.

    # Screenshot

    <img width="1325" alt="image"
    src="https://github.com/dfinity/nns-dapp/assets/98811342/ab1fbcf6-0f6e-4a8f-ac69-cb79fe990808">

commit 37633d0
Author: sa-github-api <138766536+sa-github-api@users.noreply.github.com>
Date:   Thu May 23 08:37:07 2024 +0200

    Update SNS Aggregator Response (#4906)

    # Motivation
    We would like to keep the ProdLaunchpad.spec up to date with mainnet
    data.

    # Changes
    * Update the files used for the fetch mock in ProdLaunchpad.spec.

    # Tests
    Only test changes.

    Co-authored-by: gix-bot <gix-bot@users.noreply.github.com>

commit e25ade4
Author: David de Kloet <122978264+dskloetd@users.noreply.github.com>
Date:   Wed May 22 17:35:52 2024 +0200

    Remove outdated comment (#4904)

    # Motivation

    In the `TokensTableRow` component there is a comment explaining why we
    duplicate the actions.
    But we don't actually duplicate the actions so this comment shouldn't be
    there.

    # Changes

    Remove the comment.

    # Tests

    I checked with @lmuntaner who added it.

    # Todos

    - [ ] Add entry to changelog (if necessary).
    not necessary

commit 943ed15
Author: David de Kloet <122978264+dskloetd@users.noreply.github.com>
Date:   Wed May 22 12:47:52 2024 +0200

    Set mainnet ckUSDC canister IDs (#4903)

    # Motivation

    We need the canister IDs to support ckUSDC in NNS dapp.

    I got these canister IDs from:
    ```
    $ dfx canister --network ic call vxkom-oyaaa-aaaar-qafda-cai get_orchestrator_info
    (
      record {
        cycles_management = record {
          cycles_top_up_increment = 10_000_000_000_000 : nat;
          cycles_for_ledger_creation = 150_000_000_000_000 : nat;
          cycles_for_archive_creation = 50_000_000_000_000 : nat;
          cycles_for_index_creation = 100_000_000_000_000 : nat;
        };
        managed_canisters = vec {
          record {
            erc20_contract = record {
              chain_id = 1 : nat;
              address = "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48";
            };
            ledger = opt variant {
              Installed = record {
                canister_id = principal "xevnm-gaaaa-aaaar-qafnq-cai";
                installed_wasm_hash = "4ca82938d223c77909dcf594a49ea72c07fd513726cfa7a367dd0be0d6abc679";
              }
            };
            index = opt variant {
              Installed = record {
                canister_id = principal "xrs4b-hiaaa-aaaar-qafoa-cai";
                installed_wasm_hash = "55dd5ea22b65adf877cea893765561ae290b52e7fdfdc043b5c18ffbaaa78f33";
              }
            };
            archives = vec {};
            ckerc20_token_symbol = "ckUSDC";
          };
        };
        more_controller_ids = vec { principal "r7inp-6aaaa-aaaaa-aaabq-cai" };
        minter_id = opt principal "sv3dd-oaaaa-aaaar-qacoa-cai";
      },
    )
    ```

    # Changes

    1. Add `ckusdc_ledger` and `ckusdc_index` canister IDs for `mainnet` and
    `app` networks.
    2. Ran `scripts/nns-dapp/test-config --update`.

    # Tests

    Deployed with
    https://github.com/dfinity/nns-dapp/actions/workflows/deploy-to-app.yaml
    for testing.

    # Todos

    - [ ] Add entry to changelog (if necessary).
    covered by existing entry

commit 0b71a2c
Author: Max Strasinsky <98811342+mstrasinskis@users.noreply.github.com>
Date:   Wed May 22 09:11:39 2024 +0200

    Select universe card all actionable mode (#4901)

    # Motivation

    For select "all actionable proposals" we need to have a universe card
    with the "Vote" icon and static text. To maintain the original universe
    card’s styles and functionality, we extended the existing
    SelectUniverseCard component rather than creating a new one.

    # Changes

    - Extend `SelectUniverseCard` to display a "Actionable proposals" card.

    # Tests

    - Extended.

    <img width="273" alt="image"
    src="https://github.com/dfinity/nns-dapp/assets/98811342/11e4e564-9e47-4c39-8e2f-f4e35b2be067">

    # Todos

    - [ ] Add entry to changelog (if necessary).
    Not yet.

commit ed2f186
Author: David de Kloet <122978264+dskloetd@users.noreply.github.com>
Date:   Tue May 21 19:40:38 2024 +0200

    NNS1-2905: Remove transactions fields from accounts (step 2) (#4836)

    This PR should only be merged after we have a release on mainnet
    containing #4800.

    The commit currently on mainnet:
    ```
    $ dfx canister metadata nns-dapp git_commit_id --network mainnet
    581eb32
    ```
    That
    [commit](581eb32)
    is from May 15th, well after PR #4800, which was merged May 10th.

    # Motivation

    This is the follow-up to #4800.
    In the previous PR we removed the transactions fields but still encoded
    to stable memory including the fields.
    In this PR we stop encoding the old fields completely.
    There will still be accounts in stable memory with the fields but they
    will be ignored when reading and removed when writing.
    We have not yet decided if we also want to do a migration round to
    remove all the fields from stable memory.

    # Changes

    1. Stop converting `Account` to `OldAccount` before encoding it to
    stable memory.

    # Tests

    1. `upgrade-downgrade-test` passed.
    2. Manually tested upgrading and downgrading while creating new
    subaccounts before, in between and after.

    # Todos

    - [x] Add entry to changelog (if necessary).

commit 7a9f74e
Author: Max Strasinsky <98811342+mstrasinskis@users.noreply.github.com>
Date:   Tue May 21 17:31:10 2024 +0200

    Upgrade gix components (#4898)

    # Motivation

    For the actionable page menu entry, we need an updated `Vote` icon with
    size prop support.

    # Changes

    - `npm run update:gix`

    # Tests

    Tests work.

    # Todos

    - [ ] Add entry to changelog (if necessary).
    Not necessary.

commit 9138118
Author: David de Kloet <122978264+dskloetd@users.noreply.github.com>
Date:   Tue May 21 16:26:25 2024 +0200

    Prevent installing a second snapshot before the previous one is restored (#4900)

    # Motivation

    When installing a snapshot, some files and directories are replaced with
    ones from the snapshot and the originals are placed in a backup
    directory.
    If you try to install a snapshot again, things can get confusing easily.
    Better to always restore the previous backup before installing the next.

    # Changes

    In `scripts/dfx-snapshot-install`, check if there is a directory with a
    name following the standard state backup directory name pattern. If
    there is, refuse to install the snapshot.

    # Tests

    Manually created a directory named `dfx-state-backup-123` and then tried
    to run a snapshot. Got:
    ```
    $ scripts/dfx-snapshot-start -s /Users/dskloet/snapshots/2024-05-16-ckUSDC.tar.xz
    drwxr-xr-x  2 dskloet  staff  64 May 21 15:12 /Users/dskloet/dfx-state-backup-123
    ERROR: Found existing backup directory. Restore the previous backup before installing a new snapshot.
    sh: /Users/dskloet/dfx-state-backup-20240521_152046/restore.sh: No such file or directory
    ```

    # Todos

    - [ ] Add entry to changelog (if necessary).
    not necessary

commit ead5b23
Author: David de Kloet <122978264+dskloetd@users.noreply.github.com>
Date:   Tue May 21 16:12:50 2024 +0200

    Keep existing identities when installing snapshot (#4899)

    # Motivation

    When installing an snsdemo snapshot, the entire `~/.config/dfx`
    directory gets replaced with the one from the snapshot.
    This includes all your identities.
    So while a snapshot is running, you can't use your normal identities.

    # Changes

    Instead of replacing the entire `~/.config/dfx` directory, replace all
    its contents (according to the snapshot), except the `identity`
    directory, then replace only those identities that exist in the
    snapshot, keeping the others.

    # Tests

    Ran a snapshot. Checked that identities were still there.

    # Todos

    - [ ] Add entry to changelog (if necessary).
mstrasinskis added a commit to dfinity/nns-dapp that referenced this issue May 24, 2024
commit dc70742
Author: Max Strasinsky <maksims.strasinskis@dfinity.org>
Date:   Fri May 24 11:16:32 2024 +0200

    Formatting

commit 13e85ed
Author: Max Strasinsky <maksims.strasinskis@dfinity.org>
Date:   Fri May 24 11:10:53 2024 +0200

    refactor: actionableProposalsSelected

commit d8554f9
Author: Max Strasinsky <maksims.strasinskis@dfinity.org>
Date:   Fri May 24 10:13:52 2024 +0200

    Restore removed count expectations.

commit 8e5506c
Author: Max Strasinsky <maksims.strasinskis@dfinity.org>
Date:   Fri May 24 07:14:12 2024 +0200

    fix test card.getText -> card.getName

commit 5d65598
Author: Max Strasinsky <maksims.strasinskis@dfinity.org>
Date:   Thu May 23 18:50:18 2024 +0200

    formatting

commit c956717
Author: Max Strasinsky <maksims.strasinskis@dfinity.org>
Date:   Thu May 23 17:25:39 2024 +0200

    Restore the feature flag

commit ff365ca
Author: Max Strasinsky <maksims.strasinskis@dfinity.org>
Date:   Thu May 23 17:25:24 2024 +0200

    Remove redundant trim()

commit f30202c
Merge: 5a2881b 4811a3e
Author: Max Strasinsky <maksims.strasinskis@dfinity.org>
Date:   Thu May 23 17:24:35 2024 +0200

    Merge branch 'actionable-universe-navigation' of https://github.com/dfinity/nns-dapp into actionable-universe-navigation

commit 5a2881b
Author: Max Strasinsky <maksims.strasinskis@dfinity.org>
Date:   Thu May 23 17:24:30 2024 +0200

    Add testId to universe name

commit 4811a3e
Merge: db3fdb6 87df248
Author: Max Strasinsky <98811342+mstrasinskis@users.noreply.github.com>
Date:   Thu May 23 16:02:44 2024 +0200

    Merge branch 'main' into actionable-universe-navigation

commit db3fdb6
Author: Max Strasinsky <maksims.strasinskis@dfinity.org>
Date:   Thu May 23 16:02:14 2024 +0200

    Trigger CI

commit dd941d2
Author: Max Strasinsky <maksims.strasinskis@dfinity.org>
Date:   Thu May 23 15:51:43 2024 +0200

    Cleanup

commit b8ac06d
Author: Max Strasinsky <maksims.strasinskis@dfinity.org>
Date:   Thu May 23 15:48:41 2024 +0200

    Use PO for new SelectUniverseList specs

commit f29b400
Author: Max Strasinsky <maksims.strasinskis@dfinity.org>
Date:   Thu May 23 15:48:10 2024 +0200

    New prop "testId" for Separator component

commit 102e252
Merge: c657dfd 4b8179b
Author: Max Strasinsky <98811342+mstrasinskis@users.noreply.github.com>
Date:   Thu May 23 15:15:45 2024 +0200

    Merge branch 'main' into actionable-universe-navigation

commit 87df248
Author: David de Kloet <122978264+dskloetd@users.noreply.github.com>
Date:   Thu May 23 15:15:07 2024 +0200

    Downgrade rust from 1.78 to 1.77 (#4910)

    # Motivation

    There is a bug in Rust 1.78:
    rustwasm/wasm-bindgen#3801
    I'm not sure if it affects us but better safe than sorry.

    # Changes

    Go back to the version of Rust (1.77.2) we were using before
    #4822

    # Tests

    CI

    # Todos

    - [x] Add entry to changelog (if necessary).

commit 4b8179b
Author: David de Kloet <122978264+dskloetd@users.noreply.github.com>
Date:   Thu May 23 14:33:42 2024 +0200

    Extract cell components from TokensTableRow (#4909)

    # Motivation

    We want to try to reuse the tokens table structure and style for the
    neurons table.
    The `TokensTable` component is currently very specific to the tokens
    table.
    By extracting tokens specific subcomponents, I'm hoping to separate the
    generic table structure from the tokens specific rendering.
    And this should make it easier to subsequently create a generic table
    component and use that for both the tokens table and the neurons table.

    # Changes

    1. Create `TokenTitleCell`, `TokenBalanceCell` and `TokenActionsCell`
    component.
    2. Use those components in `TokensTableRow.svelte`

    # Tests

    All tokens table functionality continues to be covered by
    `src/tests/lib/components/tokens/TokensTable.spec.ts`.

    # Todos

    - [ ] Add entry to changelog (if necessary).
    not necessary

commit aeaaf8b
Author: David de Kloet <122978264+dskloetd@users.noreply.github.com>
Date:   Thu May 23 13:23:31 2024 +0200

    Remove existing environment in env-vars.utils.spec.ts (#4908)

    # Motivation

    Unit tests can depend on environment variables set in `frontend/.env`
    which can be different depending on how `./config.sh` is run.
    In `frontend/src/tests/lib/utils/env-vars.utils.spec.ts` we stub out
    environment variables that we expect to read, but additional environment
    variables could potentially affect the test as well.

    Currently, the following
    ```
    DFX_NETWORK=mainnet ./config.sh
    npm run test -- env-vars
    ```
    fails with
    ```
     FAIL  src/tests/lib/utils/env-vars.utils.spec.ts > env-vars-utils > TVL canister ID is not mandatory
    AssertionError: expected { …(20) } to deeply equal { …(18) }

    - Expected
    + Received

      Object {
        "ckbtcIndexCanisterId": "olzyh-buaaa-aaaaa-qabga-cai",
        "ckbtcLedgerCanisterId": "oz7p6-neaaa-aaaaa-qabfa-cai",
        "ckbtcMinterCanisterId": "o66jk-a4aaa-aaaaa-qabfq-cai",
        "ckethIndexCanisterId": "of3vp-2eaaa-aaaaa-qabha-cai",
        "ckethLedgerCanisterId": "omy6t-mmaaa-aaaaa-qabgq-cai",
    +   "ckusdcIndexCanisterId": "xrs4b-hiaaa-aaaar-qafoa-cai",
    +   "ckusdcLedgerCanisterId": "xevnm-gaaaa-aaaar-qafnq-cai",
        "cyclesMintingCanisterId": "rkp4c-7iaaa-aaaaa-aaaca-cai",
        "dfxNetwork": "local",
        "featureFlags": "{\"ENABLE_CKBTC\":true,\"ENABLE_CKTESTBTC\":false,\"ENABLE_SNS\":true,\"ENABLE_SNS_2\":true,\"ENABLE_VOTING_INDICATION\":false}",
        "fetchRootKey": "true",
        "governanceCanisterId": "rrkah-fqaaa-aaaaa-aaaaq-cai",
        "host": "http://localhost:8080",
        "identityServiceUrl": "http://qhbym-qaaaa-aaaaa-aaafq-cai.localhost:8080",
        "indexCanisterId": "mecbw-6maaa-aaaaa-qabkq-cai",
        "ledgerCanisterId": "ryjl3-tyaaa-aaaaa-aaaba-cai",
        "ownCanisterId": "qsgjb-riaaa-aaaaa-aaaga-cai",
        "snsAggregatorUrl": "http://bd3sg-teaaa-aaaaa-qaaba-cai.localhost:8080",
        "tvlCanisterId": undefined,
        "wasmCanisterId": "qaa6y-5yaaa-aaaaa-aaafa-cai",
      }

     ❯ src/tests/lib/utils/env-vars.utils.spec.ts:116:26
        114|   it("TVL canister ID is not mandatory", () => {
        115|     vi.stubEnv("VITE_TVL_CANISTER_ID", "");
        116|     expect(getEnvVars()).toEqual({
           |                          ^
        117|       ...defaultExpectedEnvVars,
        118|       tvlCanisterId: undefined,

    ⎯⎯⎯⎯
    ```

    # Changes

    In `frontend/src/tests/lib/utils/env-vars.utils.spec.ts` unset all
    existing environment variables before stubbing a specific set of
    variables.

    # Tests

    Ran
    ```
    DFX_NETWORK=mainnet ./config.sh
    npm run test -- env-vars
    ```
    which fails before this change and passes after.

    # Todos

    - [ ] Add entry to changelog (if necessary).
    not necessary

commit c657dfd
Merge: 8ce718c b4daed2
Author: Max Strasinsky <98811342+mstrasinskis@users.noreply.github.com>
Date:   Thu May 23 11:34:11 2024 +0200

    Merge branch 'main' into actionable-universe-navigation

commit 8ce718c
Author: Max Strasinsky <maksims.strasinskis@dfinity.org>
Date:   Thu May 23 11:33:53 2024 +0200

    Disable flag for should have default proposal link when no feature flag set

commit a03c81e
Author: Max Strasinsky <maksims.strasinskis@dfinity.org>
Date:   Thu May 23 11:26:17 2024 +0200

    Test Actionble Proposals total count

commit 4d190c9
Author: Max Strasinsky <maksims.strasinskis@dfinity.org>
Date:   Thu May 23 11:25:51 2024 +0200

    ENABLE_ACTIONABLE_TAB = true for tests

commit 61cb1da
Author: Max Strasinsky <maksims.strasinskis@dfinity.org>
Date:   Thu May 23 10:36:42 2024 +0200

    remove redundant overrideFeatureFlagsStore.reset();

commit 645d94b
Author: Max Strasinsky <maksims.strasinskis@dfinity.org>
Date:   Thu May 23 10:32:07 2024 +0200

    refactor: use isActionableSelected instead of multiple template ifs

commit 5073ff8
Author: Max Strasinsky <maksims.strasinskis@dfinity.org>
Date:   Thu May 23 10:31:37 2024 +0200

    Comments

commit b4daed2
Author: Max Strasinsky <98811342+mstrasinskis@users.noreply.github.com>
Date:   Thu May 23 09:35:42 2024 +0200

    Snses without actionables banner (#4902)

    # Motivation

    Because not all projects support actionable proposals (return neuron
    ballots), not all actionable proposals will be shown on the actionable
    proposals page. To make it clear that there could be more votable
    proposals, we display a banner with a list of projects that do not have
    actionable support. In this PR, we create a banner component that will
    be shown on the actionable proposals page.

    # Changes

    - Add new component `ActionableProposalsNotSupportedSnses`

    # Tests

    - PO for `ActionableProposalsNotSupportedSnses`
    - Tests for `ActionableProposalsNotSupportedSnses`

    # Todos

    - [ ] Add entry to changelog (if necessary).
    not yet.

    # Screenshot

    <img width="1325" alt="image"
    src="https://github.com/dfinity/nns-dapp/assets/98811342/ab1fbcf6-0f6e-4a8f-ac69-cb79fe990808">

commit 37633d0
Author: sa-github-api <138766536+sa-github-api@users.noreply.github.com>
Date:   Thu May 23 08:37:07 2024 +0200

    Update SNS Aggregator Response (#4906)

    # Motivation
    We would like to keep the ProdLaunchpad.spec up to date with mainnet
    data.

    # Changes
    * Update the files used for the fetch mock in ProdLaunchpad.spec.

    # Tests
    Only test changes.

    Co-authored-by: gix-bot <gix-bot@users.noreply.github.com>

commit e25ade4
Author: David de Kloet <122978264+dskloetd@users.noreply.github.com>
Date:   Wed May 22 17:35:52 2024 +0200

    Remove outdated comment (#4904)

    # Motivation

    In the `TokensTableRow` component there is a comment explaining why we
    duplicate the actions.
    But we don't actually duplicate the actions so this comment shouldn't be
    there.

    # Changes

    Remove the comment.

    # Tests

    I checked with @lmuntaner who added it.

    # Todos

    - [ ] Add entry to changelog (if necessary).
    not necessary

commit 94ebe55
Author: Max Strasinsky <maksims.strasinskis@dfinity.org>
Date:   Wed May 22 17:35:29 2024 +0200

    cleanup

commit b930f4e
Author: Max Strasinsky <maksims.strasinskis@dfinity.org>
Date:   Wed May 22 17:30:28 2024 +0200

    formatting

commit cd9a713
Author: Max Strasinsky <maksims.strasinskis@dfinity.org>
Date:   Wed May 22 17:14:07 2024 +0200

    test: SelectUniverseCard for "Actionable proposals"

commit 79ce06b
Author: Max Strasinsky <maksims.strasinskis@dfinity.org>
Date:   Wed May 22 17:13:14 2024 +0200

    Display SelectUniverseCard for "Actionable proposals"

commit 39a9187
Author: Max Strasinsky <maksims.strasinskis@dfinity.org>
Date:   Wed May 22 16:11:00 2024 +0200

    test: main menu actionable proposal link

commit 189fd82
Author: Max Strasinsky <maksims.strasinskis@dfinity.org>
Date:   Wed May 22 13:23:34 2024 +0200

    Navigate to actionable on "Voting" click

commit 943ed15
Author: David de Kloet <122978264+dskloetd@users.noreply.github.com>
Date:   Wed May 22 12:47:52 2024 +0200

    Set mainnet ckUSDC canister IDs (#4903)

    # Motivation

    We need the canister IDs to support ckUSDC in NNS dapp.

    I got these canister IDs from:
    ```
    $ dfx canister --network ic call vxkom-oyaaa-aaaar-qafda-cai get_orchestrator_info
    (
      record {
        cycles_management = record {
          cycles_top_up_increment = 10_000_000_000_000 : nat;
          cycles_for_ledger_creation = 150_000_000_000_000 : nat;
          cycles_for_archive_creation = 50_000_000_000_000 : nat;
          cycles_for_index_creation = 100_000_000_000_000 : nat;
        };
        managed_canisters = vec {
          record {
            erc20_contract = record {
              chain_id = 1 : nat;
              address = "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48";
            };
            ledger = opt variant {
              Installed = record {
                canister_id = principal "xevnm-gaaaa-aaaar-qafnq-cai";
                installed_wasm_hash = "4ca82938d223c77909dcf594a49ea72c07fd513726cfa7a367dd0be0d6abc679";
              }
            };
            index = opt variant {
              Installed = record {
                canister_id = principal "xrs4b-hiaaa-aaaar-qafoa-cai";
                installed_wasm_hash = "55dd5ea22b65adf877cea893765561ae290b52e7fdfdc043b5c18ffbaaa78f33";
              }
            };
            archives = vec {};
            ckerc20_token_symbol = "ckUSDC";
          };
        };
        more_controller_ids = vec { principal "r7inp-6aaaa-aaaaa-aaabq-cai" };
        minter_id = opt principal "sv3dd-oaaaa-aaaar-qacoa-cai";
      },
    )
    ```

    # Changes

    1. Add `ckusdc_ledger` and `ckusdc_index` canister IDs for `mainnet` and
    `app` networks.
    2. Ran `scripts/nns-dapp/test-config --update`.

    # Tests

    Deployed with
    https://github.com/dfinity/nns-dapp/actions/workflows/deploy-to-app.yaml
    for testing.

    # Todos

    - [ ] Add entry to changelog (if necessary).
    covered by existing entry

commit 3a52155
Author: Max Strasinsky <maksims.strasinskis@dfinity.org>
Date:   Wed May 22 12:43:49 2024 +0200

    Extend page mock type

commit 9256eb6
Author: Max Strasinsky <maksims.strasinskis@dfinity.org>
Date:   Wed May 22 12:35:42 2024 +0200

    test: ActionableProposals visibility

commit 9de3258
Author: Max Strasinsky <maksims.strasinskis@dfinity.org>
Date:   Wed May 22 11:30:05 2024 +0200

    Add empty `ActionableProposals` page.

commit 0b71a2c
Author: Max Strasinsky <98811342+mstrasinskis@users.noreply.github.com>
Date:   Wed May 22 09:11:39 2024 +0200

    Select universe card all actionable mode (#4901)

    # Motivation

    For select "all actionable proposals" we need to have a universe card
    with the "Vote" icon and static text. To maintain the original universe
    card’s styles and functionality, we extended the existing
    SelectUniverseCard component rather than creating a new one.

    # Changes

    - Extend `SelectUniverseCard` to display a "Actionable proposals" card.

    # Tests

    - Extended.

    <img width="273" alt="image"
    src="https://github.com/dfinity/nns-dapp/assets/98811342/11e4e564-9e47-4c39-8e2f-f4e35b2be067">

    # Todos

    - [ ] Add entry to changelog (if necessary).
    Not yet.

commit ed2f186
Author: David de Kloet <122978264+dskloetd@users.noreply.github.com>
Date:   Tue May 21 19:40:38 2024 +0200

    NNS1-2905: Remove transactions fields from accounts (step 2) (#4836)

    This PR should only be merged after we have a release on mainnet
    containing #4800.

    The commit currently on mainnet:
    ```
    $ dfx canister metadata nns-dapp git_commit_id --network mainnet
    581eb32
    ```
    That
    [commit](581eb32)
    is from May 15th, well after PR #4800, which was merged May 10th.

    # Motivation

    This is the follow-up to #4800.
    In the previous PR we removed the transactions fields but still encoded
    to stable memory including the fields.
    In this PR we stop encoding the old fields completely.
    There will still be accounts in stable memory with the fields but they
    will be ignored when reading and removed when writing.
    We have not yet decided if we also want to do a migration round to
    remove all the fields from stable memory.

    # Changes

    1. Stop converting `Account` to `OldAccount` before encoding it to
    stable memory.

    # Tests

    1. `upgrade-downgrade-test` passed.
    2. Manually tested upgrading and downgrading while creating new
    subaccounts before, in between and after.

    # Todos

    - [x] Add entry to changelog (if necessary).

commit 7a9f74e
Author: Max Strasinsky <98811342+mstrasinskis@users.noreply.github.com>
Date:   Tue May 21 17:31:10 2024 +0200

    Upgrade gix components (#4898)

    # Motivation

    For the actionable page menu entry, we need an updated `Vote` icon with
    size prop support.

    # Changes

    - `npm run update:gix`

    # Tests

    Tests work.

    # Todos

    - [ ] Add entry to changelog (if necessary).
    Not necessary.

commit 9138118
Author: David de Kloet <122978264+dskloetd@users.noreply.github.com>
Date:   Tue May 21 16:26:25 2024 +0200

    Prevent installing a second snapshot before the previous one is restored (#4900)

    # Motivation

    When installing a snapshot, some files and directories are replaced with
    ones from the snapshot and the originals are placed in a backup
    directory.
    If you try to install a snapshot again, things can get confusing easily.
    Better to always restore the previous backup before installing the next.

    # Changes

    In `scripts/dfx-snapshot-install`, check if there is a directory with a
    name following the standard state backup directory name pattern. If
    there is, refuse to install the snapshot.

    # Tests

    Manually created a directory named `dfx-state-backup-123` and then tried
    to run a snapshot. Got:
    ```
    $ scripts/dfx-snapshot-start -s /Users/dskloet/snapshots/2024-05-16-ckUSDC.tar.xz
    drwxr-xr-x  2 dskloet  staff  64 May 21 15:12 /Users/dskloet/dfx-state-backup-123
    ERROR: Found existing backup directory. Restore the previous backup before installing a new snapshot.
    sh: /Users/dskloet/dfx-state-backup-20240521_152046/restore.sh: No such file or directory
    ```

    # Todos

    - [ ] Add entry to changelog (if necessary).
    not necessary

commit ead5b23
Author: David de Kloet <122978264+dskloetd@users.noreply.github.com>
Date:   Tue May 21 16:12:50 2024 +0200

    Keep existing identities when installing snapshot (#4899)

    # Motivation

    When installing an snsdemo snapshot, the entire `~/.config/dfx`
    directory gets replaced with the one from the snapshot.
    This includes all your identities.
    So while a snapshot is running, you can't use your normal identities.

    # Changes

    Instead of replacing the entire `~/.config/dfx` directory, replace all
    its contents (according to the snapshot), except the `identity`
    directory, then replace only those identities that exist in the
    snapshot, keeping the others.

    # Tests

    Ran a snapshot. Checked that identities were still there.

    # Todos

    - [ ] Add entry to changelog (if necessary).
mstrasinskis added a commit to dfinity/nns-dapp that referenced this issue May 24, 2024
commit a415872
Author: Max Strasinsky <98811342+mstrasinskis@users.noreply.github.com>
Date:   Fri May 24 13:53:20 2024 +0200

    Actionable universe navigation (#4905)

    # Motivation

    The `Actionable Proposals` page should be shown when the user clicks
    `Voting` in the main navigation or when the `Actionable Proposals` card
    in the universe navigation is clicked. With this PR, we add the card to
    the universe navigation and update the main navigation link to navigate
    to “Actionable Proposals” when the user is logged-in.
    There should be no actionable proposals visible for logged-out users.

    # Changes

    - Update main menu proposals link to navigate to "Actionable proposals".
    - Add empty component for "Actionable proposals" page.
    - Add "Actionable proposals" card to `SelectUniverseList` (Desktop. The
    card is always visible with the separator).
    - Add "Actionable proposals" card to `SelectUniverseDropdown` (Mobile.
    The card is shown only when selected, w/o the separator).

    # Tests

    - Add `testId` param to Separator component.
    - Add `ENABLE_ACTIONABLE_TAB` to `vites.setup` to rewrite it in the unit
    tests w/o a error.
    - Update mock page store to support boolean parameters values (for
    `actionable`).
    - Add test id to the `Separator` component.
    - Add PO for `ActionableProposals` empty page.
    - Tested manually that the actionable page is reachable.
    - Should display "Actionable proposals" card in

    # Todos

    - [ ] Add entry to changelog (if necessary).
    Not yet

    # Screenshot

    | Mobile | Desktop |
    |--------|--------|
    | <img width="269" alt="image"
    src="https://github.com/dfinity/nns-dapp/assets/98811342/fd98fbcb-3d53-4da5-98c5-bebfb32c492d">
    | <img width="616" alt="image"
    src="https://github.com/dfinity/nns-dapp/assets/98811342/3f3b9444-66db-42b7-bebd-c3e163ac3e89">
    |

commit ec81b0a
Author: David de Kloet <122978264+dskloetd@users.noreply.github.com>
Date:   Fri May 24 09:07:52 2024 +0200

    Remove data-title from TokensTableRow (#4911)

    # Motivation

    Having an attribute on the `TokensTableRow` which is specific to the
    tokens data makes it more difficult to make the table generic so it can
    be reused for the neurons table.
    This attribute was only used for testing.

    # Changes

    1. Remove `data-title` attribute.
    2. Instead of using the `data-title` attribute to find a specific row,
    iterate over the rows and return the one that matches.
    3. Use `await` where necessary because the method now has to be async.

    # Tests

    Pass

    # Todos

    - [ ] Add entry to changelog (if necessary).
    not necessary

commit 46ab6e3
Author: sa-github-api <138766536+sa-github-api@users.noreply.github.com>
Date:   Fri May 24 08:25:13 2024 +0200

    Update snsdemo to release-2024-05-22 (#4913)

    # Motivation
    We would like to keep the testing environment, provided by snsdemo, up
    to date.

    # Changes
    * Updated `snsdemo` version in `dfx.json`.
    * Ensured that the `dfx` version in `dfx.json` matches `snsdemo`.

    # Tests
    CI should pass.

    Co-authored-by: gix-bot <gix-bot@users.noreply.github.com>

commit 87df248
Author: David de Kloet <122978264+dskloetd@users.noreply.github.com>
Date:   Thu May 23 15:15:07 2024 +0200

    Downgrade rust from 1.78 to 1.77 (#4910)

    # Motivation

    There is a bug in Rust 1.78:
    rustwasm/wasm-bindgen#3801
    I'm not sure if it affects us but better safe than sorry.

    # Changes

    Go back to the version of Rust (1.77.2) we were using before
    #4822

    # Tests

    CI

    # Todos

    - [x] Add entry to changelog (if necessary).

commit 4b8179b
Author: David de Kloet <122978264+dskloetd@users.noreply.github.com>
Date:   Thu May 23 14:33:42 2024 +0200

    Extract cell components from TokensTableRow (#4909)

    # Motivation

    We want to try to reuse the tokens table structure and style for the
    neurons table.
    The `TokensTable` component is currently very specific to the tokens
    table.
    By extracting tokens specific subcomponents, I'm hoping to separate the
    generic table structure from the tokens specific rendering.
    And this should make it easier to subsequently create a generic table
    component and use that for both the tokens table and the neurons table.

    # Changes

    1. Create `TokenTitleCell`, `TokenBalanceCell` and `TokenActionsCell`
    component.
    2. Use those components in `TokensTableRow.svelte`

    # Tests

    All tokens table functionality continues to be covered by
    `src/tests/lib/components/tokens/TokensTable.spec.ts`.

    # Todos

    - [ ] Add entry to changelog (if necessary).
    not necessary

commit aeaaf8b
Author: David de Kloet <122978264+dskloetd@users.noreply.github.com>
Date:   Thu May 23 13:23:31 2024 +0200

    Remove existing environment in env-vars.utils.spec.ts (#4908)

    # Motivation

    Unit tests can depend on environment variables set in `frontend/.env`
    which can be different depending on how `./config.sh` is run.
    In `frontend/src/tests/lib/utils/env-vars.utils.spec.ts` we stub out
    environment variables that we expect to read, but additional environment
    variables could potentially affect the test as well.

    Currently, the following
    ```
    DFX_NETWORK=mainnet ./config.sh
    npm run test -- env-vars
    ```
    fails with
    ```
     FAIL  src/tests/lib/utils/env-vars.utils.spec.ts > env-vars-utils > TVL canister ID is not mandatory
    AssertionError: expected { …(20) } to deeply equal { …(18) }

    - Expected
    + Received

      Object {
        "ckbtcIndexCanisterId": "olzyh-buaaa-aaaaa-qabga-cai",
        "ckbtcLedgerCanisterId": "oz7p6-neaaa-aaaaa-qabfa-cai",
        "ckbtcMinterCanisterId": "o66jk-a4aaa-aaaaa-qabfq-cai",
        "ckethIndexCanisterId": "of3vp-2eaaa-aaaaa-qabha-cai",
        "ckethLedgerCanisterId": "omy6t-mmaaa-aaaaa-qabgq-cai",
    +   "ckusdcIndexCanisterId": "xrs4b-hiaaa-aaaar-qafoa-cai",
    +   "ckusdcLedgerCanisterId": "xevnm-gaaaa-aaaar-qafnq-cai",
        "cyclesMintingCanisterId": "rkp4c-7iaaa-aaaaa-aaaca-cai",
        "dfxNetwork": "local",
        "featureFlags": "{\"ENABLE_CKBTC\":true,\"ENABLE_CKTESTBTC\":false,\"ENABLE_SNS\":true,\"ENABLE_SNS_2\":true,\"ENABLE_VOTING_INDICATION\":false}",
        "fetchRootKey": "true",
        "governanceCanisterId": "rrkah-fqaaa-aaaaa-aaaaq-cai",
        "host": "http://localhost:8080",
        "identityServiceUrl": "http://qhbym-qaaaa-aaaaa-aaafq-cai.localhost:8080",
        "indexCanisterId": "mecbw-6maaa-aaaaa-qabkq-cai",
        "ledgerCanisterId": "ryjl3-tyaaa-aaaaa-aaaba-cai",
        "ownCanisterId": "qsgjb-riaaa-aaaaa-aaaga-cai",
        "snsAggregatorUrl": "http://bd3sg-teaaa-aaaaa-qaaba-cai.localhost:8080",
        "tvlCanisterId": undefined,
        "wasmCanisterId": "qaa6y-5yaaa-aaaaa-aaafa-cai",
      }

     ❯ src/tests/lib/utils/env-vars.utils.spec.ts:116:26
        114|   it("TVL canister ID is not mandatory", () => {
        115|     vi.stubEnv("VITE_TVL_CANISTER_ID", "");
        116|     expect(getEnvVars()).toEqual({
           |                          ^
        117|       ...defaultExpectedEnvVars,
        118|       tvlCanisterId: undefined,

    ⎯⎯⎯⎯
    ```

    # Changes

    In `frontend/src/tests/lib/utils/env-vars.utils.spec.ts` unset all
    existing environment variables before stubbing a specific set of
    variables.

    # Tests

    Ran
    ```
    DFX_NETWORK=mainnet ./config.sh
    npm run test -- env-vars
    ```
    which fails before this change and passes after.

    # Todos

    - [ ] Add entry to changelog (if necessary).
    not necessary

commit b4daed2
Author: Max Strasinsky <98811342+mstrasinskis@users.noreply.github.com>
Date:   Thu May 23 09:35:42 2024 +0200

    Snses without actionables banner (#4902)

    # Motivation

    Because not all projects support actionable proposals (return neuron
    ballots), not all actionable proposals will be shown on the actionable
    proposals page. To make it clear that there could be more votable
    proposals, we display a banner with a list of projects that do not have
    actionable support. In this PR, we create a banner component that will
    be shown on the actionable proposals page.

    # Changes

    - Add new component `ActionableProposalsNotSupportedSnses`

    # Tests

    - PO for `ActionableProposalsNotSupportedSnses`
    - Tests for `ActionableProposalsNotSupportedSnses`

    # Todos

    - [ ] Add entry to changelog (if necessary).
    not yet.

    # Screenshot

    <img width="1325" alt="image"
    src="https://github.com/dfinity/nns-dapp/assets/98811342/ab1fbcf6-0f6e-4a8f-ac69-cb79fe990808">

commit 37633d0
Author: sa-github-api <138766536+sa-github-api@users.noreply.github.com>
Date:   Thu May 23 08:37:07 2024 +0200

    Update SNS Aggregator Response (#4906)

    # Motivation
    We would like to keep the ProdLaunchpad.spec up to date with mainnet
    data.

    # Changes
    * Update the files used for the fetch mock in ProdLaunchpad.spec.

    # Tests
    Only test changes.

    Co-authored-by: gix-bot <gix-bot@users.noreply.github.com>

commit e25ade4
Author: David de Kloet <122978264+dskloetd@users.noreply.github.com>
Date:   Wed May 22 17:35:52 2024 +0200

    Remove outdated comment (#4904)

    # Motivation

    In the `TokensTableRow` component there is a comment explaining why we
    duplicate the actions.
    But we don't actually duplicate the actions so this comment shouldn't be
    there.

    # Changes

    Remove the comment.

    # Tests

    I checked with @lmuntaner who added it.

    # Todos

    - [ ] Add entry to changelog (if necessary).
    not necessary

commit 943ed15
Author: David de Kloet <122978264+dskloetd@users.noreply.github.com>
Date:   Wed May 22 12:47:52 2024 +0200

    Set mainnet ckUSDC canister IDs (#4903)

    # Motivation

    We need the canister IDs to support ckUSDC in NNS dapp.

    I got these canister IDs from:
    ```
    $ dfx canister --network ic call vxkom-oyaaa-aaaar-qafda-cai get_orchestrator_info
    (
      record {
        cycles_management = record {
          cycles_top_up_increment = 10_000_000_000_000 : nat;
          cycles_for_ledger_creation = 150_000_000_000_000 : nat;
          cycles_for_archive_creation = 50_000_000_000_000 : nat;
          cycles_for_index_creation = 100_000_000_000_000 : nat;
        };
        managed_canisters = vec {
          record {
            erc20_contract = record {
              chain_id = 1 : nat;
              address = "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48";
            };
            ledger = opt variant {
              Installed = record {
                canister_id = principal "xevnm-gaaaa-aaaar-qafnq-cai";
                installed_wasm_hash = "4ca82938d223c77909dcf594a49ea72c07fd513726cfa7a367dd0be0d6abc679";
              }
            };
            index = opt variant {
              Installed = record {
                canister_id = principal "xrs4b-hiaaa-aaaar-qafoa-cai";
                installed_wasm_hash = "55dd5ea22b65adf877cea893765561ae290b52e7fdfdc043b5c18ffbaaa78f33";
              }
            };
            archives = vec {};
            ckerc20_token_symbol = "ckUSDC";
          };
        };
        more_controller_ids = vec { principal "r7inp-6aaaa-aaaaa-aaabq-cai" };
        minter_id = opt principal "sv3dd-oaaaa-aaaar-qacoa-cai";
      },
    )
    ```

    # Changes

    1. Add `ckusdc_ledger` and `ckusdc_index` canister IDs for `mainnet` and
    `app` networks.
    2. Ran `scripts/nns-dapp/test-config --update`.

    # Tests

    Deployed with
    https://github.com/dfinity/nns-dapp/actions/workflows/deploy-to-app.yaml
    for testing.

    # Todos

    - [ ] Add entry to changelog (if necessary).
    covered by existing entry

commit 0b71a2c
Author: Max Strasinsky <98811342+mstrasinskis@users.noreply.github.com>
Date:   Wed May 22 09:11:39 2024 +0200

    Select universe card all actionable mode (#4901)

    # Motivation

    For select "all actionable proposals" we need to have a universe card
    with the "Vote" icon and static text. To maintain the original universe
    card’s styles and functionality, we extended the existing
    SelectUniverseCard component rather than creating a new one.

    # Changes

    - Extend `SelectUniverseCard` to display a "Actionable proposals" card.

    # Tests

    - Extended.

    <img width="273" alt="image"
    src="https://github.com/dfinity/nns-dapp/assets/98811342/11e4e564-9e47-4c39-8e2f-f4e35b2be067">

    # Todos

    - [ ] Add entry to changelog (if necessary).
    Not yet.

commit ed2f186
Author: David de Kloet <122978264+dskloetd@users.noreply.github.com>
Date:   Tue May 21 19:40:38 2024 +0200

    NNS1-2905: Remove transactions fields from accounts (step 2) (#4836)

    This PR should only be merged after we have a release on mainnet
    containing #4800.

    The commit currently on mainnet:
    ```
    $ dfx canister metadata nns-dapp git_commit_id --network mainnet
    581eb32
    ```
    That
    [commit](581eb32)
    is from May 15th, well after PR #4800, which was merged May 10th.

    # Motivation

    This is the follow-up to #4800.
    In the previous PR we removed the transactions fields but still encoded
    to stable memory including the fields.
    In this PR we stop encoding the old fields completely.
    There will still be accounts in stable memory with the fields but they
    will be ignored when reading and removed when writing.
    We have not yet decided if we also want to do a migration round to
    remove all the fields from stable memory.

    # Changes

    1. Stop converting `Account` to `OldAccount` before encoding it to
    stable memory.

    # Tests

    1. `upgrade-downgrade-test` passed.
    2. Manually tested upgrading and downgrading while creating new
    subaccounts before, in between and after.

    # Todos

    - [x] Add entry to changelog (if necessary).

commit 7a9f74e
Author: Max Strasinsky <98811342+mstrasinskis@users.noreply.github.com>
Date:   Tue May 21 17:31:10 2024 +0200

    Upgrade gix components (#4898)

    # Motivation

    For the actionable page menu entry, we need an updated `Vote` icon with
    size prop support.

    # Changes

    - `npm run update:gix`

    # Tests

    Tests work.

    # Todos

    - [ ] Add entry to changelog (if necessary).
    Not necessary.

commit 9138118
Author: David de Kloet <122978264+dskloetd@users.noreply.github.com>
Date:   Tue May 21 16:26:25 2024 +0200

    Prevent installing a second snapshot before the previous one is restored (#4900)

    # Motivation

    When installing a snapshot, some files and directories are replaced with
    ones from the snapshot and the originals are placed in a backup
    directory.
    If you try to install a snapshot again, things can get confusing easily.
    Better to always restore the previous backup before installing the next.

    # Changes

    In `scripts/dfx-snapshot-install`, check if there is a directory with a
    name following the standard state backup directory name pattern. If
    there is, refuse to install the snapshot.

    # Tests

    Manually created a directory named `dfx-state-backup-123` and then tried
    to run a snapshot. Got:
    ```
    $ scripts/dfx-snapshot-start -s /Users/dskloet/snapshots/2024-05-16-ckUSDC.tar.xz
    drwxr-xr-x  2 dskloet  staff  64 May 21 15:12 /Users/dskloet/dfx-state-backup-123
    ERROR: Found existing backup directory. Restore the previous backup before installing a new snapshot.
    sh: /Users/dskloet/dfx-state-backup-20240521_152046/restore.sh: No such file or directory
    ```

    # Todos

    - [ ] Add entry to changelog (if necessary).
    not necessary

commit ead5b23
Author: David de Kloet <122978264+dskloetd@users.noreply.github.com>
Date:   Tue May 21 16:12:50 2024 +0200

    Keep existing identities when installing snapshot (#4899)

    # Motivation

    When installing an snsdemo snapshot, the entire `~/.config/dfx`
    directory gets replaced with the one from the snapshot.
    This includes all your identities.
    So while a snapshot is running, you can't use your normal identities.

    # Changes

    Instead of replacing the entire `~/.config/dfx` directory, replace all
    its contents (according to the snapshot), except the `identity`
    directory, then replace only those identities that exist in the
    snapshot, keeping the others.

    # Tests

    Ran a snapshot. Checked that identities were still there.

    # Todos

    - [ ] Add entry to changelog (if necessary).
mstrasinskis added a commit to dfinity/nns-dapp that referenced this issue May 24, 2024
commit bb46232
Author: David de Kloet <122978264+dskloetd@users.noreply.github.com>
Date:   Fri May 24 14:53:22 2024 +0200

    Rename TokensTable to ResponsiveTable (#4914)

    # Motivation

    We want to extract the generic table logic from the tokens table in
    order to reuse it for the neurons table.
    To make it easier to review, I want to gradually evolve the tokens table
    to be more generic.
    In this PR, I rename `TokensTable` to `ResponsiveTable` and move it to a
    different directory.
    In place of the old `TokensTable` is now a super thin wrapper component.
    In subsequent PRs I will move the tokens specific code back from the
    `ResponsiveTable` to the `TokensTable` to eventually end up with a fully
    generic `ResponsiveTable`.

    The PR is easiest to review by looking at commits separately.

    # Changes

    1. git mv
    frontend/src/lib/components/tokens/TokensTable/TokensTable.svelte
    frontend/src/lib/components/ui/ResponsiveTable.svelte
    2. `git mv
    frontend/src/lib/components/tokens/TokensTable/TokensTableRow.svelte
    frontend/src/lib/components/ui/ResponsiveTableRow.svelte`
    3. Fix imports and used component names.
    4. Add back `TokensTable` which just forwards to `ResponsiveTable`.

    # Tests

    Existing test pass.
    Tested manually.
    Will add tests for `ResponsiveTable` after it is fully generic.

    # Todos

    - [ ] Add entry to changelog (if necessary).
    not necessary

commit a415872
Author: Max Strasinsky <98811342+mstrasinskis@users.noreply.github.com>
Date:   Fri May 24 13:53:20 2024 +0200

    Actionable universe navigation (#4905)

    # Motivation

    The `Actionable Proposals` page should be shown when the user clicks
    `Voting` in the main navigation or when the `Actionable Proposals` card
    in the universe navigation is clicked. With this PR, we add the card to
    the universe navigation and update the main navigation link to navigate
    to “Actionable Proposals” when the user is logged-in.
    There should be no actionable proposals visible for logged-out users.

    # Changes

    - Update main menu proposals link to navigate to "Actionable proposals".
    - Add empty component for "Actionable proposals" page.
    - Add "Actionable proposals" card to `SelectUniverseList` (Desktop. The
    card is always visible with the separator).
    - Add "Actionable proposals" card to `SelectUniverseDropdown` (Mobile.
    The card is shown only when selected, w/o the separator).

    # Tests

    - Add `testId` param to Separator component.
    - Add `ENABLE_ACTIONABLE_TAB` to `vites.setup` to rewrite it in the unit
    tests w/o a error.
    - Update mock page store to support boolean parameters values (for
    `actionable`).
    - Add test id to the `Separator` component.
    - Add PO for `ActionableProposals` empty page.
    - Tested manually that the actionable page is reachable.
    - Should display "Actionable proposals" card in

    # Todos

    - [ ] Add entry to changelog (if necessary).
    Not yet

    # Screenshot

    | Mobile | Desktop |
    |--------|--------|
    | <img width="269" alt="image"
    src="https://github.com/dfinity/nns-dapp/assets/98811342/fd98fbcb-3d53-4da5-98c5-bebfb32c492d">
    | <img width="616" alt="image"
    src="https://github.com/dfinity/nns-dapp/assets/98811342/3f3b9444-66db-42b7-bebd-c3e163ac3e89">
    |

commit ec81b0a
Author: David de Kloet <122978264+dskloetd@users.noreply.github.com>
Date:   Fri May 24 09:07:52 2024 +0200

    Remove data-title from TokensTableRow (#4911)

    # Motivation

    Having an attribute on the `TokensTableRow` which is specific to the
    tokens data makes it more difficult to make the table generic so it can
    be reused for the neurons table.
    This attribute was only used for testing.

    # Changes

    1. Remove `data-title` attribute.
    2. Instead of using the `data-title` attribute to find a specific row,
    iterate over the rows and return the one that matches.
    3. Use `await` where necessary because the method now has to be async.

    # Tests

    Pass

    # Todos

    - [ ] Add entry to changelog (if necessary).
    not necessary

commit 46ab6e3
Author: sa-github-api <138766536+sa-github-api@users.noreply.github.com>
Date:   Fri May 24 08:25:13 2024 +0200

    Update snsdemo to release-2024-05-22 (#4913)

    # Motivation
    We would like to keep the testing environment, provided by snsdemo, up
    to date.

    # Changes
    * Updated `snsdemo` version in `dfx.json`.
    * Ensured that the `dfx` version in `dfx.json` matches `snsdemo`.

    # Tests
    CI should pass.

    Co-authored-by: gix-bot <gix-bot@users.noreply.github.com>

commit 87df248
Author: David de Kloet <122978264+dskloetd@users.noreply.github.com>
Date:   Thu May 23 15:15:07 2024 +0200

    Downgrade rust from 1.78 to 1.77 (#4910)

    # Motivation

    There is a bug in Rust 1.78:
    rustwasm/wasm-bindgen#3801
    I'm not sure if it affects us but better safe than sorry.

    # Changes

    Go back to the version of Rust (1.77.2) we were using before
    #4822

    # Tests

    CI

    # Todos

    - [x] Add entry to changelog (if necessary).

commit 4b8179b
Author: David de Kloet <122978264+dskloetd@users.noreply.github.com>
Date:   Thu May 23 14:33:42 2024 +0200

    Extract cell components from TokensTableRow (#4909)

    # Motivation

    We want to try to reuse the tokens table structure and style for the
    neurons table.
    The `TokensTable` component is currently very specific to the tokens
    table.
    By extracting tokens specific subcomponents, I'm hoping to separate the
    generic table structure from the tokens specific rendering.
    And this should make it easier to subsequently create a generic table
    component and use that for both the tokens table and the neurons table.

    # Changes

    1. Create `TokenTitleCell`, `TokenBalanceCell` and `TokenActionsCell`
    component.
    2. Use those components in `TokensTableRow.svelte`

    # Tests

    All tokens table functionality continues to be covered by
    `src/tests/lib/components/tokens/TokensTable.spec.ts`.

    # Todos

    - [ ] Add entry to changelog (if necessary).
    not necessary

commit aeaaf8b
Author: David de Kloet <122978264+dskloetd@users.noreply.github.com>
Date:   Thu May 23 13:23:31 2024 +0200

    Remove existing environment in env-vars.utils.spec.ts (#4908)

    # Motivation

    Unit tests can depend on environment variables set in `frontend/.env`
    which can be different depending on how `./config.sh` is run.
    In `frontend/src/tests/lib/utils/env-vars.utils.spec.ts` we stub out
    environment variables that we expect to read, but additional environment
    variables could potentially affect the test as well.

    Currently, the following
    ```
    DFX_NETWORK=mainnet ./config.sh
    npm run test -- env-vars
    ```
    fails with
    ```
     FAIL  src/tests/lib/utils/env-vars.utils.spec.ts > env-vars-utils > TVL canister ID is not mandatory
    AssertionError: expected { …(20) } to deeply equal { …(18) }

    - Expected
    + Received

      Object {
        "ckbtcIndexCanisterId": "olzyh-buaaa-aaaaa-qabga-cai",
        "ckbtcLedgerCanisterId": "oz7p6-neaaa-aaaaa-qabfa-cai",
        "ckbtcMinterCanisterId": "o66jk-a4aaa-aaaaa-qabfq-cai",
        "ckethIndexCanisterId": "of3vp-2eaaa-aaaaa-qabha-cai",
        "ckethLedgerCanisterId": "omy6t-mmaaa-aaaaa-qabgq-cai",
    +   "ckusdcIndexCanisterId": "xrs4b-hiaaa-aaaar-qafoa-cai",
    +   "ckusdcLedgerCanisterId": "xevnm-gaaaa-aaaar-qafnq-cai",
        "cyclesMintingCanisterId": "rkp4c-7iaaa-aaaaa-aaaca-cai",
        "dfxNetwork": "local",
        "featureFlags": "{\"ENABLE_CKBTC\":true,\"ENABLE_CKTESTBTC\":false,\"ENABLE_SNS\":true,\"ENABLE_SNS_2\":true,\"ENABLE_VOTING_INDICATION\":false}",
        "fetchRootKey": "true",
        "governanceCanisterId": "rrkah-fqaaa-aaaaa-aaaaq-cai",
        "host": "http://localhost:8080",
        "identityServiceUrl": "http://qhbym-qaaaa-aaaaa-aaafq-cai.localhost:8080",
        "indexCanisterId": "mecbw-6maaa-aaaaa-qabkq-cai",
        "ledgerCanisterId": "ryjl3-tyaaa-aaaaa-aaaba-cai",
        "ownCanisterId": "qsgjb-riaaa-aaaaa-aaaga-cai",
        "snsAggregatorUrl": "http://bd3sg-teaaa-aaaaa-qaaba-cai.localhost:8080",
        "tvlCanisterId": undefined,
        "wasmCanisterId": "qaa6y-5yaaa-aaaaa-aaafa-cai",
      }

     ❯ src/tests/lib/utils/env-vars.utils.spec.ts:116:26
        114|   it("TVL canister ID is not mandatory", () => {
        115|     vi.stubEnv("VITE_TVL_CANISTER_ID", "");
        116|     expect(getEnvVars()).toEqual({
           |                          ^
        117|       ...defaultExpectedEnvVars,
        118|       tvlCanisterId: undefined,

    ⎯⎯⎯⎯
    ```

    # Changes

    In `frontend/src/tests/lib/utils/env-vars.utils.spec.ts` unset all
    existing environment variables before stubbing a specific set of
    variables.

    # Tests

    Ran
    ```
    DFX_NETWORK=mainnet ./config.sh
    npm run test -- env-vars
    ```
    which fails before this change and passes after.

    # Todos

    - [ ] Add entry to changelog (if necessary).
    not necessary

commit b4daed2
Author: Max Strasinsky <98811342+mstrasinskis@users.noreply.github.com>
Date:   Thu May 23 09:35:42 2024 +0200

    Snses without actionables banner (#4902)

    # Motivation

    Because not all projects support actionable proposals (return neuron
    ballots), not all actionable proposals will be shown on the actionable
    proposals page. To make it clear that there could be more votable
    proposals, we display a banner with a list of projects that do not have
    actionable support. In this PR, we create a banner component that will
    be shown on the actionable proposals page.

    # Changes

    - Add new component `ActionableProposalsNotSupportedSnses`

    # Tests

    - PO for `ActionableProposalsNotSupportedSnses`
    - Tests for `ActionableProposalsNotSupportedSnses`

    # Todos

    - [ ] Add entry to changelog (if necessary).
    not yet.

    # Screenshot

    <img width="1325" alt="image"
    src="https://github.com/dfinity/nns-dapp/assets/98811342/ab1fbcf6-0f6e-4a8f-ac69-cb79fe990808">

commit 37633d0
Author: sa-github-api <138766536+sa-github-api@users.noreply.github.com>
Date:   Thu May 23 08:37:07 2024 +0200

    Update SNS Aggregator Response (#4906)

    # Motivation
    We would like to keep the ProdLaunchpad.spec up to date with mainnet
    data.

    # Changes
    * Update the files used for the fetch mock in ProdLaunchpad.spec.

    # Tests
    Only test changes.

    Co-authored-by: gix-bot <gix-bot@users.noreply.github.com>

commit e25ade4
Author: David de Kloet <122978264+dskloetd@users.noreply.github.com>
Date:   Wed May 22 17:35:52 2024 +0200

    Remove outdated comment (#4904)

    # Motivation

    In the `TokensTableRow` component there is a comment explaining why we
    duplicate the actions.
    But we don't actually duplicate the actions so this comment shouldn't be
    there.

    # Changes

    Remove the comment.

    # Tests

    I checked with @lmuntaner who added it.

    # Todos

    - [ ] Add entry to changelog (if necessary).
    not necessary

commit 943ed15
Author: David de Kloet <122978264+dskloetd@users.noreply.github.com>
Date:   Wed May 22 12:47:52 2024 +0200

    Set mainnet ckUSDC canister IDs (#4903)

    # Motivation

    We need the canister IDs to support ckUSDC in NNS dapp.

    I got these canister IDs from:
    ```
    $ dfx canister --network ic call vxkom-oyaaa-aaaar-qafda-cai get_orchestrator_info
    (
      record {
        cycles_management = record {
          cycles_top_up_increment = 10_000_000_000_000 : nat;
          cycles_for_ledger_creation = 150_000_000_000_000 : nat;
          cycles_for_archive_creation = 50_000_000_000_000 : nat;
          cycles_for_index_creation = 100_000_000_000_000 : nat;
        };
        managed_canisters = vec {
          record {
            erc20_contract = record {
              chain_id = 1 : nat;
              address = "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48";
            };
            ledger = opt variant {
              Installed = record {
                canister_id = principal "xevnm-gaaaa-aaaar-qafnq-cai";
                installed_wasm_hash = "4ca82938d223c77909dcf594a49ea72c07fd513726cfa7a367dd0be0d6abc679";
              }
            };
            index = opt variant {
              Installed = record {
                canister_id = principal "xrs4b-hiaaa-aaaar-qafoa-cai";
                installed_wasm_hash = "55dd5ea22b65adf877cea893765561ae290b52e7fdfdc043b5c18ffbaaa78f33";
              }
            };
            archives = vec {};
            ckerc20_token_symbol = "ckUSDC";
          };
        };
        more_controller_ids = vec { principal "r7inp-6aaaa-aaaaa-aaabq-cai" };
        minter_id = opt principal "sv3dd-oaaaa-aaaar-qacoa-cai";
      },
    )
    ```

    # Changes

    1. Add `ckusdc_ledger` and `ckusdc_index` canister IDs for `mainnet` and
    `app` networks.
    2. Ran `scripts/nns-dapp/test-config --update`.

    # Tests

    Deployed with
    https://github.com/dfinity/nns-dapp/actions/workflows/deploy-to-app.yaml
    for testing.

    # Todos

    - [ ] Add entry to changelog (if necessary).
    covered by existing entry

commit 0b71a2c
Author: Max Strasinsky <98811342+mstrasinskis@users.noreply.github.com>
Date:   Wed May 22 09:11:39 2024 +0200

    Select universe card all actionable mode (#4901)

    # Motivation

    For select "all actionable proposals" we need to have a universe card
    with the "Vote" icon and static text. To maintain the original universe
    card’s styles and functionality, we extended the existing
    SelectUniverseCard component rather than creating a new one.

    # Changes

    - Extend `SelectUniverseCard` to display a "Actionable proposals" card.

    # Tests

    - Extended.

    <img width="273" alt="image"
    src="https://github.com/dfinity/nns-dapp/assets/98811342/11e4e564-9e47-4c39-8e2f-f4e35b2be067">

    # Todos

    - [ ] Add entry to changelog (if necessary).
    Not yet.

commit ed2f186
Author: David de Kloet <122978264+dskloetd@users.noreply.github.com>
Date:   Tue May 21 19:40:38 2024 +0200

    NNS1-2905: Remove transactions fields from accounts (step 2) (#4836)

    This PR should only be merged after we have a release on mainnet
    containing #4800.

    The commit currently on mainnet:
    ```
    $ dfx canister metadata nns-dapp git_commit_id --network mainnet
    581eb32
    ```
    That
    [commit](581eb32)
    is from May 15th, well after PR #4800, which was merged May 10th.

    # Motivation

    This is the follow-up to #4800.
    In the previous PR we removed the transactions fields but still encoded
    to stable memory including the fields.
    In this PR we stop encoding the old fields completely.
    There will still be accounts in stable memory with the fields but they
    will be ignored when reading and removed when writing.
    We have not yet decided if we also want to do a migration round to
    remove all the fields from stable memory.

    # Changes

    1. Stop converting `Account` to `OldAccount` before encoding it to
    stable memory.

    # Tests

    1. `upgrade-downgrade-test` passed.
    2. Manually tested upgrading and downgrading while creating new
    subaccounts before, in between and after.

    # Todos

    - [x] Add entry to changelog (if necessary).

commit 7a9f74e
Author: Max Strasinsky <98811342+mstrasinskis@users.noreply.github.com>
Date:   Tue May 21 17:31:10 2024 +0200

    Upgrade gix components (#4898)

    # Motivation

    For the actionable page menu entry, we need an updated `Vote` icon with
    size prop support.

    # Changes

    - `npm run update:gix`

    # Tests

    Tests work.

    # Todos

    - [ ] Add entry to changelog (if necessary).
    Not necessary.

commit 9138118
Author: David de Kloet <122978264+dskloetd@users.noreply.github.com>
Date:   Tue May 21 16:26:25 2024 +0200

    Prevent installing a second snapshot before the previous one is restored (#4900)

    # Motivation

    When installing a snapshot, some files and directories are replaced with
    ones from the snapshot and the originals are placed in a backup
    directory.
    If you try to install a snapshot again, things can get confusing easily.
    Better to always restore the previous backup before installing the next.

    # Changes

    In `scripts/dfx-snapshot-install`, check if there is a directory with a
    name following the standard state backup directory name pattern. If
    there is, refuse to install the snapshot.

    # Tests

    Manually created a directory named `dfx-state-backup-123` and then tried
    to run a snapshot. Got:
    ```
    $ scripts/dfx-snapshot-start -s /Users/dskloet/snapshots/2024-05-16-ckUSDC.tar.xz
    drwxr-xr-x  2 dskloet  staff  64 May 21 15:12 /Users/dskloet/dfx-state-backup-123
    ERROR: Found existing backup directory. Restore the previous backup before installing a new snapshot.
    sh: /Users/dskloet/dfx-state-backup-20240521_152046/restore.sh: No such file or directory
    ```

    # Todos

    - [ ] Add entry to changelog (if necessary).
    not necessary

commit ead5b23
Author: David de Kloet <122978264+dskloetd@users.noreply.github.com>
Date:   Tue May 21 16:12:50 2024 +0200

    Keep existing identities when installing snapshot (#4899)

    # Motivation

    When installing an snsdemo snapshot, the entire `~/.config/dfx`
    directory gets replaced with the one from the snapshot.
    This includes all your identities.
    So while a snapshot is running, you can't use your normal identities.

    # Changes

    Instead of replacing the entire `~/.config/dfx` directory, replace all
    its contents (according to the snapshot), except the `identity`
    directory, then replace only those identities that exist in the
    snapshot, keeping the others.

    # Tests

    Ran a snapshot. Checked that identities were still there.

    # Todos

    - [ ] Add entry to changelog (if necessary).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
3 participants