Skip to content
This repository has been archived by the owner on Nov 19, 2024. It is now read-only.

Commit

Permalink
Merge branch 'master' into mraszyk/deprecation-reformulation
Browse files Browse the repository at this point in the history
  • Loading branch information
mraszyk authored Nov 21, 2023
2 parents 17d2d93 + 93846ce commit b7d3463
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 16 deletions.
1 change: 1 addition & 0 deletions spec/_attachments/interface-spec-changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
* Increase the maximum number of globals in a canister's WASM.
* Add per-call context performance counter.
* Update the computation of the representation-independent hash for the case of maps with nested maps.
* Remove `senders` field from user delegations.

### 0.21.0 (2023-09-18) {#0_21_0}
* Canister cycle balance cannot decrease below the freezing limit after executing `install_code` on the management canister.
Expand Down
1 change: 0 additions & 1 deletion spec/_attachments/requests.cddl
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@ signed-delegation = {
pubkey: bytes
expiration: timestamp
? targets: [* principal]
? senders: [* principal]
}
signature: bytes
}
Expand Down
2 changes: 1 addition & 1 deletion spec/http-gateway-protocol-spec.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ Response verification fills the security gap left by query calls. It is a versio
- Otherwise, verification fails.
5. Parse the `expr_path` field from the `IC-Certificate` header value as per [the certificate header](#the-certificate-header).
6. The parsed `expr_path` is valid as per [Expression Path](#expression-path) otherwise, verification fails.
7. Case-insensitive search for the `IC-CertificationExpression` header.
7. Case-insensitive search for the `IC-CertificateExpression` header.
- If no such header is found, verification fails.
- If the header value is not structured as per [the certificate expression header](#the-certificate-expression-header), verification fails.
8. Let `expr_hash` be the label of the node in the tree at path `expr_path`.
Expand Down
21 changes: 7 additions & 14 deletions spec/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -894,8 +894,6 @@ Signing transactions can be delegated from one key to another one. If delegation

- `targets` (`array` of `CanisterId`, optional): If this field is set, the delegation only applies for requests sent to the canisters in the list. The list must contain no more than 1000 elements; otherwise, the request will not be accepted by the IC.

- `senders` (`array` of `Principal`, optional): If this field is set, the delegation only applies for requests originating from the principals in the list.

- `signature` (`blob`): Signature on the 32-byte [representation-independent hash](#hash-of-map) of the map contained in the `delegation` field as described in [Signatures](#signatures), using the 27 bytes `\x1Aic-request-auth-delegation` as the domain separator.

For the first delegation in the array, this signature is created with the key corresponding to the public key from the `sender_pubkey` field, all subsequent delegations are signed with the key corresponding to the public key contained in the preceding delegation.
Expand Down Expand Up @@ -1716,7 +1714,7 @@ This call traps if the amount of cycles refunded does not fit into a 64-bit valu

Canisters have the ability to store and retrieve data from a secondary memory. The purpose of this *stable memory* is to provide space to store data beyond upgrades. The interface mirrors roughly the memory-related instructions of WebAssembly, and tries to be forward compatible with exposing this feature as an additional memory.

The stable memory is initially empty and can be grown up to 32 GiB (provided the subnet has capacity).
The stable memory is initially empty and can be grown up to the [Wasm stable memory limit](https://internetcomputer.org/docs/current/developer-docs/backend/resource-limits#resource-constraints-and-limits) (provided the subnet has capacity).

- `ic0.stable_size : () → (page_count : i32)`

Expand Down Expand Up @@ -2016,6 +2014,8 @@ This method traps if the canister's cycle balance decreases below the canister's

This method installs code that had previously been uploaded in chunks.

Only controllers of the target canister can call this method.

The `mode`, `arg`, and `sender_canister_version` parameters are as for `install_code`.
The `target_canister` specifies the canister where the code should be installed.
The optional `storage_canister` specifies the canister in whose chunk storage the chunks are stored (this parameter defaults to `target_canister` if not specified).
Expand Down Expand Up @@ -2839,7 +2839,6 @@ Signed delegations contain the (unsigned) delegation data in a nested record, ne
delegation : {
pubkey : PublicKey;
targets : [CanisterId] | Unrestricted;
senders : [Principal] | Unrestricted;
expiration : Timestamp
};
signature : Signature
Expand Down Expand Up @@ -3052,26 +3051,20 @@ The following predicate describes when an envelope `E` correctly signs the enclo
= { p : p is CanisterID } if U = anonymous_id
verify_envelope({ content = C, sender_pubkey = PK, sender_sig = Sig, sender_delegation = DS}, U, T)
= TS if U = mk_self_authenticating_id E.sender_pubkey
∧ (PK', TS) = verify_delegations(DS, PK, T, { p : p is CanisterId }, U)
∧ (PK', TS) = verify_delegations(DS, PK, T, { p : p is CanisterId })
∧ verify_signature PK' Sig ("\x0Aic-request" · hash_of_map(C))

verify_delegations([], PK, T, TS, U) = (PK, TS)
verify_delegations([D] · DS, PK, T, TS, U)
= verify_delegations(DS, D.pubkey, T, TS ∩ delegation_targets(D), U)
verify_delegations([], PK, T, TS) = (PK, TS)
verify_delegations([D] · DS, PK, T, TS)
= verify_delegations(DS, D.pubkey, T, TS ∩ delegation_targets(D))
if verify_signature PK D.signature ("\x1Aic-request-auth-delegation" · hash_of_map(D.delegation))
∧ D.delegation.expiration ≥ T
∧ U ∈ delegated_senders(D)

delegation_targets(D)
= if D.targets = Unrestricted
then { p : p is CanisterId }
else D.targets

delegated_senders(D)
= if D.senders = Unrestricted
then { p : p is Principal }
else D.senders

#### Effective canister ids

A `Request` has an effective canister id according to the rules in [Effective canister id](#http-effective-canister-id):
Expand Down

0 comments on commit b7d3463

Please sign in to comment.