@stellar-registry/perch-artifacts 0.2.2 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -1
- package/constants.json +5 -1
- package/dist/index.d.ts +31 -0
- package/package.json +2 -2
- package/scripts/fetch-infra-wasm.sh +28 -15
- package/vectors/diagnostic-events.json +1 -3
package/README.md
CHANGED
|
@@ -41,7 +41,11 @@ file is stale:
|
|
|
41
41
|
|
|
42
42
|
```json
|
|
43
43
|
{
|
|
44
|
-
"doc_compiler": {
|
|
44
|
+
"doc_compiler": {
|
|
45
|
+
"MAX_DOC_SIGNERS": 8, "MAX_DOC_RULES": 10, "MAX_DOC_CANONICAL_BYTES": 8192,
|
|
46
|
+
"MAX_GRANT_SIGNERS": 15, "MAX_GRANT_RULES": 50, "MAX_GRANT_CANONICAL_BYTES": 8192,
|
|
47
|
+
"MAX_GRANT_STORED_BYTES": 49152, "MAX_RULE_NAME_BYTES": 20
|
|
48
|
+
},
|
|
45
49
|
"program": { "PROGRAM_VERSION": 1, "MAX_PROGRAM_LEN": 256, "MAX_STACK_DEPTH": 128 }
|
|
46
50
|
}
|
|
47
51
|
```
|
package/constants.json
CHANGED
|
@@ -2,8 +2,12 @@
|
|
|
2
2
|
"comment": "Written by crates/integration-tests/tests/artifact_constants.rs (PERCH_BLESS=1) from the crates' own constants.",
|
|
3
3
|
"doc_compiler": {
|
|
4
4
|
"MAX_DOC_CANONICAL_BYTES": 8192,
|
|
5
|
-
"MAX_DOC_RULES":
|
|
5
|
+
"MAX_DOC_RULES": 10,
|
|
6
6
|
"MAX_DOC_SIGNERS": 8,
|
|
7
|
+
"MAX_GRANT_CANONICAL_BYTES": 8192,
|
|
8
|
+
"MAX_GRANT_RULES": 50,
|
|
9
|
+
"MAX_GRANT_SIGNERS": 15,
|
|
10
|
+
"MAX_GRANT_STORED_BYTES": 49152,
|
|
7
11
|
"MAX_RULE_NAME_BYTES": 20
|
|
8
12
|
},
|
|
9
13
|
"program": {
|
package/dist/index.d.ts
CHANGED
|
@@ -32,6 +32,18 @@ export interface DeployedContract {
|
|
|
32
32
|
/** sha256 of every contract this one was built against. */
|
|
33
33
|
pins: Record<string, string>;
|
|
34
34
|
}
|
|
35
|
+
/** A verifier in `perch/verifiers`. `contracts.<name>.address` is the
|
|
36
|
+
* registry's copy of the same bytes, which no account admits as an admin
|
|
37
|
+
* verifier. */
|
|
38
|
+
export interface DeployedVerifier {
|
|
39
|
+
version: string;
|
|
40
|
+
sha256: string;
|
|
41
|
+
bytes: number;
|
|
42
|
+
/** Its `verifier-name`: `<name>@<version>`. */
|
|
43
|
+
name: string;
|
|
44
|
+
/** Its content address in `perch/verifiers`: what a document names. */
|
|
45
|
+
address: string;
|
|
46
|
+
}
|
|
35
47
|
/** A deployment manifest (`deployments/<network>.json`, written by scripts/deploy-stack.sh). */
|
|
36
48
|
export interface Deployment {
|
|
37
49
|
schema: number;
|
|
@@ -54,6 +66,18 @@ export interface Deployment {
|
|
|
54
66
|
manager: string;
|
|
55
67
|
root: string;
|
|
56
68
|
};
|
|
69
|
+
/** `perch/verifiers`, where a document's `verifier-name` resolves and the
|
|
70
|
+
* factory pins its WebAuthn verifier, with each stack verifier it serves.
|
|
71
|
+
* Absent from a deployment that predates it, whose factory pins the
|
|
72
|
+
* registry's copy. */
|
|
73
|
+
verifiers?: {
|
|
74
|
+
id: string;
|
|
75
|
+
wasm_hash: string;
|
|
76
|
+
admin: string;
|
|
77
|
+
manager: string;
|
|
78
|
+
root: string;
|
|
79
|
+
contracts: Record<string, DeployedVerifier>;
|
|
80
|
+
};
|
|
57
81
|
zk: {
|
|
58
82
|
circuit_id: string;
|
|
59
83
|
tree_depth: number;
|
|
@@ -90,10 +114,17 @@ export declare const circuitManifest: CircuitManifest;
|
|
|
90
114
|
/** Limits no contract view reports, written from the crates' own constants
|
|
91
115
|
* by crates/integration-tests/tests/artifact_constants.rs. */
|
|
92
116
|
export interface Constants {
|
|
117
|
+
/** An account document's caps (`MAX_DOC_*`), a grant document's
|
|
118
|
+
* (`MAX_GRANT_*`), and the rule-name cap both share. */
|
|
93
119
|
doc_compiler: {
|
|
94
120
|
MAX_DOC_SIGNERS: number;
|
|
95
121
|
MAX_DOC_RULES: number;
|
|
96
122
|
MAX_DOC_CANONICAL_BYTES: number;
|
|
123
|
+
MAX_GRANT_SIGNERS: number;
|
|
124
|
+
MAX_GRANT_RULES: number;
|
|
125
|
+
MAX_GRANT_CANONICAL_BYTES: number;
|
|
126
|
+
/** The largest ledger entry a grant document may make its account store. */
|
|
127
|
+
MAX_GRANT_STORED_BYTES: number;
|
|
97
128
|
MAX_RULE_NAME_BYTES: number;
|
|
98
129
|
};
|
|
99
130
|
program: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stellar-registry/perch-artifacts",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "Perch's consumable artifacts as files: deployment manifests, the Noir ZK recovery circuits and their manifest, test vectors, document and program limits, and the scripts that fetch the deployed wasm and install the pinned ZK toolchain",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|
|
@@ -52,5 +52,5 @@
|
|
|
52
52
|
"url": "https://github.com/stellar-registry/perch",
|
|
53
53
|
"directory": "packages/perch-artifacts"
|
|
54
54
|
},
|
|
55
|
-
"gitHead": "
|
|
55
|
+
"gitHead": "e844485f0a5abe460916482b033489a4349eebbd"
|
|
56
56
|
}
|
|
@@ -7,15 +7,17 @@
|
|
|
7
7
|
# crates/perch-account-factory/wasm/ perch-account, perch-webauthn-verifier
|
|
8
8
|
#
|
|
9
9
|
# Each name gets <name>.wasm (git-ignored; only tests read the bytes) and
|
|
10
|
-
# <name>.sha256 (committed, with registry
|
|
11
|
-
# checkout builds without this script). scripts/check-pins.sh checks
|
|
12
|
-
# committed pins against the manifest.
|
|
10
|
+
# <name>.sha256 (committed, with the registry paths: all a build reads, so a
|
|
11
|
+
# plain checkout builds without this script). scripts/check-pins.sh checks
|
|
12
|
+
# the committed pins against the manifest.
|
|
13
13
|
#
|
|
14
|
-
# The
|
|
15
|
-
#
|
|
16
|
-
# that path derives on its network, or a migration
|
|
17
|
-
# deployments/pending-registry.json declares (scripts/manifest-registry.sh)
|
|
18
|
-
#
|
|
14
|
+
# The registries are not fetched pins. The account commits the path it
|
|
15
|
+
# derives the infra registry from (wasm/registry.path), and the manifest's
|
|
16
|
+
# registry must be the one that path derives on its network, or a migration
|
|
17
|
+
# deployments/pending-registry.json declares (scripts/manifest-registry.sh);
|
|
18
|
+
# this script refuses any other manifest. The factory pins only the WebAuthn
|
|
19
|
+
# verifier's hash, which it resolves in perch/verifiers (wasm/verifiers.path).
|
|
20
|
+
# This script never rewrites a path.
|
|
19
21
|
#
|
|
20
22
|
# Each wasm is fetched from the chain by the exact address (or, for the
|
|
21
23
|
# account, the exact wasm hash) the manifest records, and refused unless
|
|
@@ -28,10 +30,11 @@
|
|
|
28
30
|
#
|
|
29
31
|
# Usage: scripts/fetch-infra-wasm.sh [--manifest <path>] [--stack <dir>]
|
|
30
32
|
# --manifest default deployments/${STELLAR_NETWORK:-testnet}.json
|
|
31
|
-
# --stack also fetch every manifest contract
|
|
32
|
-
#
|
|
33
|
-
#
|
|
34
|
-
#
|
|
33
|
+
# --stack also fetch every manifest contract, and the registry code
|
|
34
|
+
# (the manifest's registry.wasm_hash, which perch/verifiers
|
|
35
|
+
# runs too), into <dir> and write <dir>/build.json, so
|
|
36
|
+
# tests/release_stack.rs runs against the deployed bytes; it
|
|
37
|
+
# keeps the manifest's zk circuit, which those bytes compile in
|
|
35
38
|
#
|
|
36
39
|
# Requires the Stellar CLI. After a redeploy, run
|
|
37
40
|
# `cargo test -p perch-integration-tests --test testnet_pins`.
|
|
@@ -141,10 +144,20 @@ if [ -n "$stack" ]; then
|
|
|
141
144
|
for name in $(m '.contracts | keys[]'); do
|
|
142
145
|
fetch "$name" "$stack/${name//-/_}.wasm"
|
|
143
146
|
done
|
|
144
|
-
|
|
145
|
-
|
|
147
|
+
code="$stack/perch_constructorless_registry.wasm"
|
|
148
|
+
fetch_retry perch-constructorless-registry "$code" --wasm-hash "$(m .registry.wasm_hash)"
|
|
149
|
+
[ "$(sha256 "$code")" = "$(m .registry.wasm_hash)" ] || {
|
|
150
|
+
echo "error: perch-constructorless-registry: fetched $(sha256 "$code"), manifest says $(m .registry.wasm_hash)" >&2
|
|
151
|
+
exit 1
|
|
152
|
+
}
|
|
153
|
+
jq --argjson bytes "$(wc -c <"$code" | tr -d ' ')" \
|
|
154
|
+
'{registry: .registry.id, source, toolchain} + (if .zk then {zk} else {} end) + {
|
|
155
|
+
artifacts: ([.contracts | to_entries[] |
|
|
146
156
|
{package: .key, version: .value.version, wasm: (.key | gsub("-"; "_") + ".wasm"),
|
|
147
157
|
sha256: .value.sha256, bytes: .value.bytes, tier: .value.tier,
|
|
148
|
-
pins: (.value.pins // {})}]
|
|
158
|
+
pins: (.value.pins // {})}] + [
|
|
159
|
+
{package: "perch-constructorless-registry", version: .registry.version,
|
|
160
|
+
wasm: "perch_constructorless_registry.wasm", sha256: .registry.wasm_hash, bytes: $bytes,
|
|
161
|
+
tier: -1, pins: {}}])}' "$manifest" >"$stack/build.json"
|
|
149
162
|
echo "wrote ${stack%/}/build.json" >&2
|
|
150
163
|
fi
|
|
@@ -3,9 +3,7 @@
|
|
|
3
3
|
{
|
|
4
4
|
"account": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAVAX5",
|
|
5
5
|
"events": [
|
|
6
|
-
"
|
|
7
|
-
"AAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAoAAAACAAAAAAAAAAIAAAAPAAAABWVycm9yAAAAAAAAAgAAAAAAAAu4AAAADgAAABllc2NhbGF0aW5nIGVycm9yIHRvIHBhbmljAAAA",
|
|
8
|
-
"AAAAAAAA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