Skip to content

Commit

Permalink
Merge branch 'master' into update-frontend-templates
Browse files Browse the repository at this point in the history
  • Loading branch information
dfx-json authored Dec 18, 2024
2 parents 3563018 + 5a3667f commit 472d1f5
Show file tree
Hide file tree
Showing 12 changed files with 225 additions and 126 deletions.
7 changes: 7 additions & 0 deletions .github/repo_policies/BOT_APPROVED_FILES
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# List of approved files that can be changed by a bot via an automated PR
# This is to increase security and prevent accidentally updating files that shouldn't be changed by a bot
Cargo.lock
CHANGELOG.md
nix/sources.json
src/dfx/Cargo.toml
src/dfx/assets/dfx-asset-sources.toml
30 changes: 30 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,19 @@

# UNRELEASED

### fix: `dfx deploy --by-proposal` no longer sends chunk data in ProposeCommitBatch

Recently we made `dfx deploy` include some chunk data in CommitBatch, in order to streamline
deploys for smaller projects. `dfx deploy` splits up larger change lists and submits them in
smaller batches, in order to remain within message and compute limits.

This change also applied to `dfx deploy --by-proposal`, which submits all changes in a single
message. This made it more likely that `dfx deploy --by-proposal` will fail due to exceeding
message limits.

This fix makes it so `dfx deploy --by-proposal` never includes this chunk data in
ProposeCommitBatch, which will allow for more changes before hitting message limits.

### feat: `dfx start --pocketic` supports `--force` and shared networks.

`dfx start --pocketic` is now compatible with `--force` and shared networks.
Expand Down Expand Up @@ -83,6 +96,23 @@ and reserves that much space for the ValueSerializer's buffer.

Updated Motoko to [0.13.5](https://github.com/dfinity/motoko/releases/tag/0.13.5)

### Replica

Updated replica to elected commit 3e24396441e4c7380928d4e8b4ccff7de77d0e7e.
This incorporates the following executed proposals:

- [134497](https://dashboard.internetcomputer.org/proposal/134497)
- [134408](https://dashboard.internetcomputer.org/proposal/134408)
- [134337](https://dashboard.internetcomputer.org/proposal/134337)
- [134336](https://dashboard.internetcomputer.org/proposal/134336)
- [134259](https://dashboard.internetcomputer.org/proposal/134259)
- [134251](https://dashboard.internetcomputer.org/proposal/134251)
- [134250](https://dashboard.internetcomputer.org/proposal/134250)
- [134188](https://dashboard.internetcomputer.org/proposal/134188)
- [134187](https://dashboard.internetcomputer.org/proposal/134187)
- [134186](https://dashboard.internetcomputer.org/proposal/134186)
- [134185](https://dashboard.internetcomputer.org/proposal/134185)

# 0.24.3

### feat: Bitcoin support in PocketIC
Expand Down
10 changes: 6 additions & 4 deletions Cargo.lock

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

29 changes: 29 additions & 0 deletions e2e/tests-dfx/assetscanister.bash
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,35 @@ check_permission_failure() {
assert_contains "cache-control: max-age=888"
}

@test "deploy --by-proposal lots of small assets should not overflow message limits" {
assert_command dfx identity new controller --storage-mode plaintext
assert_command dfx identity new prepare --storage-mode plaintext
assert_command dfx identity new commit --storage-mode plaintext
assert_command dfx identity use anonymous

CONTROLLER_PRINCIPAL=$(dfx identity get-principal --identity controller)
PREPARE_PRINCIPAL=$(dfx identity get-principal --identity prepare)
COMMIT_PRINCIPAL=$(dfx identity get-principal --identity commit)

dfx_start
assert_command dfx deploy --identity controller

assert_command dfx canister call e2e_project_frontend grant_permission "(record { to_principal=principal \"$PREPARE_PRINCIPAL\"; permission = variant { Prepare }; })" --identity controller
assert_command dfx canister call e2e_project_frontend grant_permission "(record { to_principal=principal \"$COMMIT_PRINCIPAL\"; permission = variant { Commit }; })" --identity controller

for a in $(seq 1 1400); do
# 1400 files * ~1200 header bytes: 1,680,000 bytes
# 1400 files * 650 content bytes = 910,000 bytes: small enough that chunk uploader won't upload before finalize
# commit batch without content: 1,978,870 bytes
# commit batch with content: 2,889,392 bytes
# change finalize_upload to always pass MAX_CHUNK_SIZE/2 to see this fail
dd if=/dev/random of=src/e2e_project_frontend/assets/"$a" bs=650 count=1
done

assert_command dfx deploy e2e_project_frontend --by-proposal --identity prepare
assert_match "Proposed commit of batch 2 with evidence [0-9a-z]*. Either commit it by proposal, or delete it."
}

@test "deploy --by-proposal all assets" {
assert_command dfx identity new controller --storage-mode plaintext
assert_command dfx identity new prepare --storage-mode plaintext
Expand Down
Loading

0 comments on commit 472d1f5

Please sign in to comment.