@agoric/cosmic-swingset 0.42.0-upgrade-14-dev-c8f9e7b.0 → 0.42.0-upgrade-16-dev-07b0130.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/CHANGELOG.md +32 -43
- package/Makefile +4 -4
- package/README.md +8 -8
- package/calc-rpcport.js +1 -0
- package/economy-template.json +13 -12
- package/package.json +31 -22
- package/perf.sh +4 -1
- package/src/anylogger-agoric.js +41 -28
- package/src/chain-main.js +25 -26
- package/src/export-kernel-db.js +9 -11
- package/src/import-kernel-db.js +3 -6
- package/src/kernel-stats.js +2 -2
- package/src/launch-chain.js +18 -7
- package/src/params.js +4 -1
- package/src/sim-chain.js +0 -1
- package/src/sim-params.js +8 -3
- /package/{jsconfig.json → tsconfig.json} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -3,38 +3,7 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
-
## [0.42.0-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
### Features
|
|
10
|
-
|
|
11
|
-
* add exporter.getHostKV() API ([16435d2](https://github.com/Agoric/agoric-sdk/commit/16435d20e9ede86916a54c7bae54ecfc59e4c950)), closes [#8523](https://github.com/Agoric/agoric-sdk/issues/8523)
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
### Bug Fixes
|
|
15
|
-
|
|
16
|
-
* export state-sync snapshot without a DB write-lock ([2d388c2](https://github.com/Agoric/agoric-sdk/commit/2d388c2d51425b9d98b79d54ea6a2de96da67042)), closes [#8523](https://github.com/Agoric/agoric-sdk/issues/8523)
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
## [0.42.0-u12.0](https://github.com/Agoric/agoric-sdk/compare/@agoric/cosmic-swingset@0.42.0-u11wf.0...@agoric/cosmic-swingset@0.42.0-u12.0) (2023-11-10)
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
### Features
|
|
24
|
-
|
|
25
|
-
* **cosmic-swingset:** add begin block check and transaction ([#8432](https://github.com/Agoric/agoric-sdk/issues/8432)) ([06302a2](https://github.com/Agoric/agoric-sdk/commit/06302a2d28271e1a962545e2952703af77a28f53))
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
## [0.42.0-u11wf.0](https://github.com/Agoric/agoric-sdk/compare/@agoric/cosmic-swingset@0.42.0-u11.0...@agoric/cosmic-swingset@0.42.0-u11wf.0) (2023-09-23)
|
|
30
|
-
|
|
31
|
-
**Note:** Version bump only for package @agoric/cosmic-swingset
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
## [0.42.0-u11.0](https://github.com/Agoric/agoric-sdk/compare/@agoric/cosmic-swingset@0.41.3...@agoric/cosmic-swingset@0.42.0-u11.0) (2023-08-24)
|
|
6
|
+
## [0.42.0-u16.0](https://github.com/Agoric/agoric-sdk/compare/@agoric/cosmic-swingset@0.41.3...@agoric/cosmic-swingset@0.42.0-u16.0) (2024-07-02)
|
|
38
7
|
|
|
39
8
|
|
|
40
9
|
### ⚠ BREAKING CHANGES
|
|
@@ -44,25 +13,45 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
|
|
|
44
13
|
|
|
45
14
|
### Features
|
|
46
15
|
|
|
47
|
-
*
|
|
48
|
-
*
|
|
49
|
-
* **
|
|
50
|
-
* **cosmic-swingset:**
|
|
51
|
-
* **cosmic-swingset:**
|
|
52
|
-
* **
|
|
53
|
-
* **
|
|
16
|
+
* add exporter.getHostKV() API ([eb564f9](https://github.com/Agoric/agoric-sdk/commit/eb564f9635397c0706e1f8255b3e125681e2d031)), closes [#8523](https://github.com/Agoric/agoric-sdk/issues/8523)
|
|
17
|
+
* Add tooling for standalone performance benchmarks ([058e54a](https://github.com/Agoric/agoric-sdk/commit/058e54aad93c04b57dfb3a411bff85c223ab5dd7))
|
|
18
|
+
* **agd:** try harder to find cosmic-swingset ([dd547f0](https://github.com/Agoric/agoric-sdk/commit/dd547f0a8057109a0bbe27a814fb3fc403ad3fd1))
|
|
19
|
+
* **cosmic-swingset:** add begin block check and transaction ([#8432](https://github.com/Agoric/agoric-sdk/issues/8432)) ([a9d113a](https://github.com/Agoric/agoric-sdk/commit/a9d113a09dfd93889ae985533535df53fdc771e7))
|
|
20
|
+
* **cosmic-swingset:** add JS upgrade plan handler stub ([655133e](https://github.com/Agoric/agoric-sdk/commit/655133ed909b5d632dc033e992214a7b6a1b5ab1))
|
|
21
|
+
* **cosmic-swingset:** add repair-metadata snapshot restore option ([4fc0113](https://github.com/Agoric/agoric-sdk/commit/4fc01134fab9402d5916f0593728acce4697da9e))
|
|
22
|
+
* **cosmic-swingset:** implement `ENACTED_UPGRADE` blocking send ([3825c17](https://github.com/Agoric/agoric-sdk/commit/3825c171f3528cd3c4e63e8aeb3363a3e88b75fc))
|
|
23
|
+
* **cosmic-swingset:** replace import/export options ([0f01712](https://github.com/Agoric/agoric-sdk/commit/0f01712cadef12784afa547d568a6e77b9a83344))
|
|
24
|
+
* **cosmic-swingset:** run upgrade actions to completion ([140712a](https://github.com/Agoric/agoric-sdk/commit/140712a25fbadbe513158f5a706793d1bde12c17))
|
|
25
|
+
* **cosmic-swingset:** use x/swingset for swing-store export data ([1534add](https://github.com/Agoric/agoric-sdk/commit/1534adde558df456e3225b8384e2a7033d5a5d18))
|
|
26
|
+
* **cosmos:** add required export-dir export cmd option ([3be2986](https://github.com/Agoric/agoric-sdk/commit/3be2986059c9f007d34518deef68e31956e9b45e))
|
|
27
|
+
* **cosmos:** support core proposals set by upgrade handler ([605eb4b](https://github.com/Agoric/agoric-sdk/commit/605eb4b8f33d7646c3a9084d43ecd51029e12b80))
|
|
28
|
+
* **cosmos:** wire new swingset port handler ([ea582bf](https://github.com/Agoric/agoric-sdk/commit/ea582bf7738f82d0abe5529ee1ac9f2e117c957a))
|
|
29
|
+
* new 'boot' package with bootstrap configs ([8e3173b](https://github.com/Agoric/agoric-sdk/commit/8e3173b0b86a3dc90b31164bc4272c54e46a6641))
|
|
30
|
+
* Simple removal of lien primarilly through code search ([#8988](https://github.com/Agoric/agoric-sdk/issues/8988)) ([695c440](https://github.com/Agoric/agoric-sdk/commit/695c440c0f48a3591b15a43665682c5f1ebbad9d))
|
|
31
|
+
* support `coreProposals.steps` ([80fa3d1](https://github.com/Agoric/agoric-sdk/commit/80fa3d14494706d825f51ac22e1bbf4ec68ce404))
|
|
32
|
+
* **vat-transfer:** first cut at working proposal ([2864bd5](https://github.com/Agoric/agoric-sdk/commit/2864bd5c12300c3595df9676bcfde894dbe59b29))
|
|
33
|
+
* vm-config package ([8b1ecad](https://github.com/Agoric/agoric-sdk/commit/8b1ecad8ab50db777bc11c3ee6fcdb37d6cb38b6))
|
|
54
34
|
|
|
55
35
|
|
|
56
36
|
### Bug Fixes
|
|
57
37
|
|
|
58
|
-
* **cosmic-swingset:** backwards param compat in import/export ([
|
|
59
|
-
* **cosmic-swingset:** log level for swing-store export ([
|
|
60
|
-
* **
|
|
38
|
+
* **cosmic-swingset:** backwards param compat in import/export ([bd49484](https://github.com/Agoric/agoric-sdk/commit/bd49484e5777b8675ed3be5e78e46f6a5d89b7db))
|
|
39
|
+
* **cosmic-swingset:** log level for swing-store export ([33c4a51](https://github.com/Agoric/agoric-sdk/commit/33c4a517f079c4ad17c30f9d1d13f181b06f112f))
|
|
40
|
+
* **cosmic-swingset:** merge `coreProposals` from bootstrap and upgrade plan ([2b38ebc](https://github.com/Agoric/agoric-sdk/commit/2b38ebc378847a878725419db37580405df0a28e))
|
|
41
|
+
* **cosmic-swingset:** only require vatconfig if uninitialized ([cfb72f3](https://github.com/Agoric/agoric-sdk/commit/cfb72f337cf650f303adfebaeffb1ee9ad0c0a92))
|
|
42
|
+
* **cosmic-swingset:** only search for the `vatconfig` on init ([b14ca40](https://github.com/Agoric/agoric-sdk/commit/b14ca404ea5bc314f99372a3eba878926f94f679))
|
|
43
|
+
* **cosmic-swingset:** send started event before beginning actual export ([3c94159](https://github.com/Agoric/agoric-sdk/commit/3c94159bbe4b27a14eeb27612c4a73afa556c472))
|
|
44
|
+
* DEBUG harmony ([#8136](https://github.com/Agoric/agoric-sdk/issues/8136)) ([d2ea4b4](https://github.com/Agoric/agoric-sdk/commit/d2ea4b46b9efa61e97eec8711830d9fdd741ca55))
|
|
45
|
+
* endow with original unstructured `assert` ([#9514](https://github.com/Agoric/agoric-sdk/issues/9514)) ([ce64840](https://github.com/Agoric/agoric-sdk/commit/ce64840f599ee7b73cbe455cc41eecec3464430a)), closes [#9515](https://github.com/Agoric/agoric-sdk/issues/9515) [#5672](https://github.com/Agoric/agoric-sdk/issues/5672) [#8332](https://github.com/Agoric/agoric-sdk/issues/8332) [#9513](https://github.com/Agoric/agoric-sdk/issues/9513) [#5672](https://github.com/Agoric/agoric-sdk/issues/5672) [#8332](https://github.com/Agoric/agoric-sdk/issues/8332) [#9513](https://github.com/Agoric/agoric-sdk/issues/9513) [#9515](https://github.com/Agoric/agoric-sdk/issues/9515) [#5672](https://github.com/Agoric/agoric-sdk/issues/5672) [#5672](https://github.com/Agoric/agoric-sdk/issues/5672) [#9513](https://github.com/Agoric/agoric-sdk/issues/9513) [#9513](https://github.com/Agoric/agoric-sdk/issues/9513)
|
|
46
|
+
* export state-sync snapshot without a DB write-lock ([3bc3799](https://github.com/Agoric/agoric-sdk/commit/3bc37990fd813136dab33dd93a1dcec073b187f9)), closes [#8523](https://github.com/Agoric/agoric-sdk/issues/8523)
|
|
47
|
+
* **sim-params:** power_flag casing ([66955c1](https://github.com/Agoric/agoric-sdk/commit/66955c1e70b63e6525ea10bc946f7c1a84e1e869))
|
|
48
|
+
* update for `[@jessie](https://github.com/jessie).js/safe-await-separator` ([94c6b3c](https://github.com/Agoric/agoric-sdk/commit/94c6b3c83a5326594f1e2886ae01d6a703a7a68f))
|
|
49
|
+
* **x/swingset:** switch export/import to replay artifact level ([6ab24b2](https://github.com/Agoric/agoric-sdk/commit/6ab24b299f31affc0a638cc6352678a2c167044c))
|
|
61
50
|
|
|
62
51
|
|
|
63
52
|
### Build System
|
|
64
53
|
|
|
65
|
-
* remove deprecated `ag-cosmos-helper` ([
|
|
54
|
+
* remove deprecated `ag-cosmos-helper` ([6866ebe](https://github.com/Agoric/agoric-sdk/commit/6866ebe670c257b60dfb6951c295e21ce0fe2fcc))
|
|
66
55
|
|
|
67
56
|
|
|
68
57
|
|
package/Makefile
CHANGED
|
@@ -141,18 +141,18 @@ scenario2-setup:
|
|
|
141
141
|
|
|
142
142
|
t1/decentral-economy-config.json: $(ECONOMY_PROPOSALS)
|
|
143
143
|
jq -s '.[0] * { coreProposals: .[1] }' \
|
|
144
|
-
../
|
|
144
|
+
../vm-config/decentral-core-config.json \
|
|
145
145
|
'$(ECONOMY_PROPOSALS)' > t1/decentral-economy-config.json
|
|
146
146
|
|
|
147
147
|
scenario2-run-chain-economy: t1/decentral-economy-config.json
|
|
148
|
-
echo "DEPRECATED use: CHAIN_BOOTSTRAP_VAT_CONFIG=@agoric/
|
|
148
|
+
echo "DEPRECATED use: CHAIN_BOOTSTRAP_VAT_CONFIG=@agoric/vm-config/decentral-itest-vaults-config.json scenario2-run-chain"
|
|
149
149
|
CHAIN_BOOTSTRAP_VAT_CONFIG="$$PWD/t1/decentral-economy-config.json" \
|
|
150
150
|
$(MAKE) scenario2-run-chain
|
|
151
151
|
|
|
152
152
|
# We want to use the same configuration that will be deployed to the next
|
|
153
153
|
# devnet.agoric.net so that developers can test their code against it locally.
|
|
154
|
-
scenario2-run-chain: ../
|
|
155
|
-
CHAIN_BOOTSTRAP_VAT_CONFIG="$${CHAIN_BOOTSTRAP_VAT_CONFIG-$$PWD/../
|
|
154
|
+
scenario2-run-chain: ../vm-config/decentral-devnet-config.json
|
|
155
|
+
CHAIN_BOOTSTRAP_VAT_CONFIG="$${CHAIN_BOOTSTRAP_VAT_CONFIG-$$PWD/../vm-config/decentral-devnet-config.json}" \
|
|
156
156
|
OTEL_EXPORTER_PROMETHEUS_PORT=$(OTEL_EXPORTER_PROMETHEUS_PORT) \
|
|
157
157
|
$(AGC) --home=t1/n0 start --log_level=warn $(AGC_START_ARGS)
|
|
158
158
|
|
package/README.md
CHANGED
|
@@ -52,7 +52,7 @@ agd --help
|
|
|
52
52
|
|
|
53
53
|
#### Scenario 3 : no testnet (develop off-chain demo)
|
|
54
54
|
|
|
55
|
-
In this scenario, you run:
|
|
55
|
+
In this scenario, you run:
|
|
56
56
|
- a **solo node** with the server-side Pixel Demo running and exposing an HTTP server in localhost
|
|
57
57
|
- a **web browser** connecting to the solo node and enabling user interaction with the Pixel Demo
|
|
58
58
|
|
|
@@ -76,7 +76,7 @@ The HTML frontend code is pure JS/DOM (no additional libraries yet) in the
|
|
|
76
76
|
|
|
77
77
|
#### Scenario 2: a single local testnet node (develop on-chain demo)
|
|
78
78
|
|
|
79
|
-
In this scenario, you run:
|
|
79
|
+
In this scenario, you run:
|
|
80
80
|
- one or several **solo node(s)** each exposing an HTTP server in localhost (each to a different port)
|
|
81
81
|
- a **single local blockchain testnet node** with the server-side Pixel Demo running
|
|
82
82
|
- a **web browser** connecting to each solo node via a different port and enabling user interaction with the Pixel Demo
|
|
@@ -107,12 +107,12 @@ You can communicate with the node by opening http://localhost:8000/
|
|
|
107
107
|
You can start other solo nodes with `make scenario2-run-client BASE_PORT=8001` and `make scenario2-run-client BASE_PORT=8002` and communicate with them respectively with on http://localhost:8001/ and http://localhost:8002/
|
|
108
108
|
|
|
109
109
|
|
|
110
|
-
|
|
110
|
+
|
|
111
111
|
#### Scenario 1: your own local testnet (develop testnet provisioner)
|
|
112
112
|
|
|
113
|
-
In this scenario, you run:
|
|
113
|
+
In this scenario, you run:
|
|
114
114
|
- a **solo node** exposing an HTTP server in localhost
|
|
115
|
-
- a **several local blockchain testnet nodes** with the server-side Pixel Demo running on top.
|
|
115
|
+
- a **several local blockchain testnet nodes** with the server-side Pixel Demo running on top.
|
|
116
116
|
- a **web browser** connecting to the solo node and enabling user interaction with the Pixel Demo
|
|
117
117
|
|
|
118
118
|
This scenario is only useful for moving toward deploying the local source code as a new testnet. Before using this scenario, you should test your on-chain code under Scenario 2.
|
|
@@ -132,7 +132,7 @@ See [Testnet Tutorial](#testnet-tutorial) for more guidance.
|
|
|
132
132
|
|
|
133
133
|
#### Scenario 0: a public testnet (kick the tires)
|
|
134
134
|
|
|
135
|
-
In this scenario, you run:
|
|
135
|
+
In this scenario, you run:
|
|
136
136
|
- a **solo node** exposing an HTTP server in localhost
|
|
137
137
|
- a **web browser** connecting to the solo node and enabling user interaction with the Pixel Demo
|
|
138
138
|
|
|
@@ -148,7 +148,7 @@ Alternatively, running the solo node from a Docker image and no local source cod
|
|
|
148
148
|
|
|
149
149
|
Now go to http://localhost:8000/ to interact with your new solo node.
|
|
150
150
|
|
|
151
|
-
Learn more about ERTP [here](https://agoric.com/documentation/ertp/guide/).
|
|
151
|
+
Learn more about ERTP [here](https://agoric.com/documentation/ertp/guide/).
|
|
152
152
|
|
|
153
153
|
### Initial Endowments
|
|
154
154
|
|
|
@@ -194,7 +194,7 @@ If you are not running on Linux, you will need to use Docker to provide the setu
|
|
|
194
194
|
|
|
195
195
|
If you want to install the Docker image scripts on this machine, run:
|
|
196
196
|
|
|
197
|
-
```
|
|
197
|
+
```sh
|
|
198
198
|
$ sudo make docker-install
|
|
199
199
|
```
|
|
200
200
|
|
package/calc-rpcport.js
CHANGED
|
@@ -11,6 +11,7 @@ import toml from '@iarna/toml';
|
|
|
11
11
|
|
|
12
12
|
const configString = fs.readFileSync(process.argv[2]).toString();
|
|
13
13
|
const config = toml.parse(configString);
|
|
14
|
+
// @ts-expect-error Property 'laddr' does not exist on type 'AnyJson'
|
|
14
15
|
const { laddr } = config.rpc; // like tcp://0.0.0.0:26657
|
|
15
16
|
// eslint-disable-next-line no-useless-escape
|
|
16
17
|
const m = laddr.match(/^tcp:\/\/([\d\.]+):(\d+)$/);
|
package/economy-template.json
CHANGED
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"steps": [
|
|
3
3
|
[
|
|
4
|
-
"@agoric/
|
|
4
|
+
"@agoric/builders/scripts/vats/init-core.js"
|
|
5
5
|
],
|
|
6
6
|
[
|
|
7
|
-
"@agoric/
|
|
8
|
-
"@agoric/
|
|
7
|
+
"@agoric/builders/scripts/vats/init-network.js",
|
|
8
|
+
"@agoric/builders/scripts/pegasus/init-core.js",
|
|
9
|
+
"@agoric/builders/scripts/vats/init-transfer.js"
|
|
9
10
|
],
|
|
10
11
|
[
|
|
11
12
|
{
|
|
12
|
-
"module": "@agoric/inter-protocol/
|
|
13
|
+
"module": "@agoric/builders/scripts/inter-protocol/init-core.js",
|
|
13
14
|
"entrypoint": "defaultProposalBuilder",
|
|
14
15
|
"args": [
|
|
15
16
|
{
|
|
@@ -21,7 +22,7 @@
|
|
|
21
22
|
]
|
|
22
23
|
},
|
|
23
24
|
{
|
|
24
|
-
"module": "@agoric/inter-protocol/
|
|
25
|
+
"module": "@agoric/builders/scripts/inter-protocol/add-collateral-core.js",
|
|
25
26
|
"entrypoint": "defaultProposalBuilder",
|
|
26
27
|
"args": [
|
|
27
28
|
{
|
|
@@ -36,7 +37,7 @@
|
|
|
36
37
|
]
|
|
37
38
|
},
|
|
38
39
|
{
|
|
39
|
-
"module": "@agoric/inter-protocol/
|
|
40
|
+
"module": "@agoric/builders/scripts/inter-protocol/add-collateral-core.js",
|
|
40
41
|
"entrypoint": "psmProposalBuilder",
|
|
41
42
|
"args": [
|
|
42
43
|
{
|
|
@@ -50,7 +51,7 @@
|
|
|
50
51
|
]
|
|
51
52
|
},
|
|
52
53
|
{
|
|
53
|
-
"module": "@agoric/inter-protocol/
|
|
54
|
+
"module": "@agoric/builders/scripts/inter-protocol/add-collateral-core.js",
|
|
54
55
|
"entrypoint": "psmProposalBuilder",
|
|
55
56
|
"args": [
|
|
56
57
|
{
|
|
@@ -64,7 +65,7 @@
|
|
|
64
65
|
]
|
|
65
66
|
},
|
|
66
67
|
{
|
|
67
|
-
"module": "@agoric/inter-protocol/
|
|
68
|
+
"module": "@agoric/builders/scripts/inter-protocol/add-collateral-core.js",
|
|
68
69
|
"entrypoint": "psmProposalBuilder",
|
|
69
70
|
"args": [
|
|
70
71
|
{
|
|
@@ -78,7 +79,7 @@
|
|
|
78
79
|
]
|
|
79
80
|
},
|
|
80
81
|
{
|
|
81
|
-
"module": "@agoric/inter-protocol/
|
|
82
|
+
"module": "@agoric/builders/scripts/inter-protocol/add-collateral-core.js",
|
|
82
83
|
"entrypoint": "psmProposalBuilder",
|
|
83
84
|
"args": [
|
|
84
85
|
{
|
|
@@ -92,7 +93,7 @@
|
|
|
92
93
|
]
|
|
93
94
|
},
|
|
94
95
|
{
|
|
95
|
-
"module": "@agoric/inter-protocol/
|
|
96
|
+
"module": "@agoric/builders/scripts/inter-protocol/add-collateral-core.js",
|
|
96
97
|
"entrypoint": "psmProposalBuilder",
|
|
97
98
|
"args": [
|
|
98
99
|
{
|
|
@@ -106,7 +107,7 @@
|
|
|
106
107
|
]
|
|
107
108
|
},
|
|
108
109
|
{
|
|
109
|
-
"module": "@agoric/inter-protocol/
|
|
110
|
+
"module": "@agoric/builders/scripts/inter-protocol/price-feed-core.js",
|
|
110
111
|
"entrypoint": "defaultProposalBuilder",
|
|
111
112
|
"args": [
|
|
112
113
|
{
|
|
@@ -131,7 +132,7 @@
|
|
|
131
132
|
]
|
|
132
133
|
},
|
|
133
134
|
{
|
|
134
|
-
"module": "@agoric/inter-protocol/
|
|
135
|
+
"module": "@agoric/builders/scripts/inter-protocol/invite-committee-core.js",
|
|
135
136
|
"entrypoint": "defaultProposalBuilder",
|
|
136
137
|
"args": [
|
|
137
138
|
{
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agoric/cosmic-swingset",
|
|
3
|
-
"version": "0.42.0-upgrade-
|
|
3
|
+
"version": "0.42.0-upgrade-16-dev-07b0130.0+07b0130",
|
|
4
4
|
"description": "Agoric's Cosmos blockchain integration",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -15,28 +15,31 @@
|
|
|
15
15
|
"test:xs": "exit 0",
|
|
16
16
|
"lint-fix": "yarn lint:eslint --fix",
|
|
17
17
|
"lint": "run-s --continue-on-error lint:*",
|
|
18
|
-
"lint:types": "tsc
|
|
18
|
+
"lint:types": "tsc",
|
|
19
19
|
"lint:eslint": "eslint ."
|
|
20
20
|
},
|
|
21
21
|
"keywords": [],
|
|
22
22
|
"author": "Agoric",
|
|
23
23
|
"license": "Apache-2.0",
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@agoric/assert": "0.6.1-upgrade-
|
|
26
|
-
"@agoric/
|
|
27
|
-
"@agoric/
|
|
28
|
-
"@agoric/
|
|
29
|
-
"@agoric/
|
|
30
|
-
"@agoric/
|
|
31
|
-
"@agoric/
|
|
32
|
-
"@agoric/
|
|
33
|
-
"@
|
|
34
|
-
"@
|
|
35
|
-
"@endo/
|
|
36
|
-
"@endo/
|
|
37
|
-
"@endo/
|
|
38
|
-
"@endo/
|
|
39
|
-
"@endo/
|
|
25
|
+
"@agoric/assert": "0.6.1-upgrade-16-dev-07b0130.0+07b0130",
|
|
26
|
+
"@agoric/builders": "0.2.0-upgrade-16-dev-07b0130.0+07b0130",
|
|
27
|
+
"@agoric/cosmos": "0.35.0-upgrade-16-dev-07b0130.0+07b0130",
|
|
28
|
+
"@agoric/deploy-script-support": "0.10.4-upgrade-16-dev-07b0130.0+07b0130",
|
|
29
|
+
"@agoric/internal": "0.4.0-upgrade-16-dev-07b0130.0+07b0130",
|
|
30
|
+
"@agoric/store": "0.9.3-upgrade-16-dev-07b0130.0+07b0130",
|
|
31
|
+
"@agoric/swing-store": "0.9.2-upgrade-16-dev-07b0130.0+07b0130",
|
|
32
|
+
"@agoric/swingset-vat": "0.33.0-upgrade-16-dev-07b0130.0+07b0130",
|
|
33
|
+
"@agoric/telemetry": "0.6.3-upgrade-16-dev-07b0130.0+07b0130",
|
|
34
|
+
"@agoric/vm-config": "0.1.1-upgrade-16-dev-07b0130.0+07b0130",
|
|
35
|
+
"@endo/bundle-source": "^3.2.3",
|
|
36
|
+
"@endo/env-options": "^1.1.4",
|
|
37
|
+
"@endo/far": "^1.1.2",
|
|
38
|
+
"@endo/import-bundle": "^1.1.2",
|
|
39
|
+
"@endo/init": "^1.1.2",
|
|
40
|
+
"@endo/marshal": "^1.5.0",
|
|
41
|
+
"@endo/nat": "^5.0.7",
|
|
42
|
+
"@endo/promise-kit": "^1.1.2",
|
|
40
43
|
"@iarna/toml": "^2.2.3",
|
|
41
44
|
"@opentelemetry/api": "~1.3.0",
|
|
42
45
|
"@opentelemetry/sdk-metrics": "~1.9.0",
|
|
@@ -46,20 +49,26 @@
|
|
|
46
49
|
"tmp": "^0.2.1"
|
|
47
50
|
},
|
|
48
51
|
"devDependencies": {
|
|
49
|
-
"ava": "^5.
|
|
50
|
-
"c8": "^
|
|
52
|
+
"ava": "^5.3.0",
|
|
53
|
+
"c8": "^9.1.0"
|
|
51
54
|
},
|
|
52
55
|
"publishConfig": {
|
|
53
56
|
"access": "public"
|
|
54
57
|
},
|
|
55
58
|
"engines": {
|
|
56
|
-
"node": "
|
|
59
|
+
"node": "^18.12 || ^20.9"
|
|
57
60
|
},
|
|
58
61
|
"ava": {
|
|
59
62
|
"files": [
|
|
60
|
-
"test
|
|
63
|
+
"test/**/*.test.*"
|
|
64
|
+
],
|
|
65
|
+
"require": [
|
|
66
|
+
"@endo/init/debug.js"
|
|
61
67
|
],
|
|
62
68
|
"timeout": "20m"
|
|
63
69
|
},
|
|
64
|
-
"
|
|
70
|
+
"typeCoverage": {
|
|
71
|
+
"atLeast": 80.49
|
|
72
|
+
},
|
|
73
|
+
"gitHead": "07b01308eaccca903919d495aded620c9849efc7"
|
|
65
74
|
}
|
package/perf.sh
CHANGED
|
@@ -21,7 +21,10 @@ curl "$url"
|
|
|
21
21
|
# Run the Apache Benchmark:
|
|
22
22
|
ab -n 16000 -c 5 "$url"
|
|
23
23
|
|
|
24
|
-
{
|
|
24
|
+
{
|
|
25
|
+
sleep 1
|
|
26
|
+
: NOTE: This will time out because of rate limiting
|
|
27
|
+
} &
|
|
25
28
|
# This one hangs (because of rate limiting at around 16350 requests since the
|
|
26
29
|
# last one started):
|
|
27
30
|
ab -n 3000 -c 5 "$url"
|
package/src/anylogger-agoric.js
CHANGED
|
@@ -1,45 +1,55 @@
|
|
|
1
|
-
|
|
1
|
+
import {
|
|
2
|
+
getEnvironmentOptionsList,
|
|
3
|
+
getEnvironmentOption,
|
|
4
|
+
} from '@endo/env-options';
|
|
2
5
|
import anylogger from 'anylogger';
|
|
3
6
|
|
|
4
7
|
// Turn on debugging output with DEBUG=agoric
|
|
5
8
|
|
|
6
|
-
const
|
|
7
|
-
let debugging;
|
|
9
|
+
const DEBUG_LIST = getEnvironmentOptionsList('DEBUG');
|
|
8
10
|
|
|
9
|
-
const
|
|
10
|
-
|
|
11
|
-
if (!debugEnv.includes('SwingSet:vat')) {
|
|
12
|
-
filterOutPrefixes.push('SwingSet:vat:');
|
|
13
|
-
}
|
|
14
|
-
// Mute liveSlots logging unless requested, for determinism.
|
|
15
|
-
if (!debugEnv.includes('SwingSet:ls')) {
|
|
16
|
-
filterOutPrefixes.push('SwingSet:ls:');
|
|
17
|
-
}
|
|
11
|
+
const isVatLogNameColon = nameColon =>
|
|
12
|
+
['SwingSet:ls:', 'SwingSet:vat:'].some(sel => nameColon.startsWith(sel));
|
|
18
13
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
14
|
+
// Turn on debugging output with DEBUG=agoric or DEBUG=agoric:${level}
|
|
15
|
+
let selectedLevel =
|
|
16
|
+
DEBUG_LIST.length || getEnvironmentOption('DEBUG', 'unset') === 'unset'
|
|
17
|
+
? 'log'
|
|
18
|
+
: 'info';
|
|
19
|
+
for (const selector of DEBUG_LIST) {
|
|
20
|
+
const parts = selector.split(':');
|
|
21
|
+
if (parts[0] !== 'agoric') {
|
|
22
|
+
continue;
|
|
23
|
+
}
|
|
24
|
+
if (parts.length > 1) {
|
|
25
|
+
selectedLevel = parts[1];
|
|
26
|
+
} else {
|
|
27
|
+
selectedLevel = 'debug';
|
|
28
|
+
}
|
|
28
29
|
}
|
|
29
|
-
const
|
|
30
|
+
const selectedCode = anylogger.levels[selectedLevel];
|
|
31
|
+
const globalCode = selectedCode === undefined ? -Infinity : selectedCode;
|
|
30
32
|
|
|
31
33
|
const oldExt = anylogger.ext;
|
|
32
34
|
anylogger.ext = (l, o) => {
|
|
33
35
|
l = oldExt(l, o);
|
|
34
|
-
l.enabledFor = lvl =>
|
|
36
|
+
l.enabledFor = lvl => globalCode >= anylogger.levels[lvl];
|
|
35
37
|
|
|
36
38
|
const prefix = l.name.replace(/:/g, ': ');
|
|
37
|
-
|
|
39
|
+
|
|
40
|
+
const nameColon = `${l.name}:`;
|
|
41
|
+
const logBelongsToVat = isVatLogNameColon(nameColon);
|
|
42
|
+
|
|
43
|
+
// If this is a vat log, then it is enabled by a selector in DEBUG_LIST.
|
|
44
|
+
const logMatchesSelector =
|
|
45
|
+
!logBelongsToVat ||
|
|
46
|
+
DEBUG_LIST.some(selector => {
|
|
47
|
+
const selectorColon = `${selector}:`;
|
|
48
|
+
return nameColon.startsWith(selectorColon);
|
|
49
|
+
});
|
|
50
|
+
|
|
38
51
|
for (const [level, code] of Object.entries(anylogger.levels)) {
|
|
39
|
-
if (
|
|
40
|
-
// Disable printing.
|
|
41
|
-
l[level] = () => {};
|
|
42
|
-
} else {
|
|
52
|
+
if (logMatchesSelector && globalCode >= code) {
|
|
43
53
|
// Enable the printing with a prefix.
|
|
44
54
|
const doLog = l[level];
|
|
45
55
|
if (doLog) {
|
|
@@ -51,6 +61,9 @@ anylogger.ext = (l, o) => {
|
|
|
51
61
|
} else {
|
|
52
62
|
l[level] = () => {};
|
|
53
63
|
}
|
|
64
|
+
} else {
|
|
65
|
+
// Disable printing.
|
|
66
|
+
l[level] = () => {};
|
|
54
67
|
}
|
|
55
68
|
}
|
|
56
69
|
return l;
|
package/src/chain-main.js
CHANGED
|
@@ -11,8 +11,8 @@ import tmpfs from 'tmp';
|
|
|
11
11
|
import { fork } from 'node:child_process';
|
|
12
12
|
|
|
13
13
|
import { E } from '@endo/far';
|
|
14
|
-
import engineGC from '@agoric/
|
|
15
|
-
import { waitUntilQuiescent } from '@agoric/
|
|
14
|
+
import engineGC from '@agoric/internal/src/lib-nodejs/engine-gc.js';
|
|
15
|
+
import { waitUntilQuiescent } from '@agoric/internal/src/lib-nodejs/waitUntilQuiescent.js';
|
|
16
16
|
import {
|
|
17
17
|
importMailbox,
|
|
18
18
|
exportMailbox,
|
|
@@ -30,7 +30,7 @@ import { makeShutdown } from '@agoric/internal/src/node/shutdown.js';
|
|
|
30
30
|
|
|
31
31
|
import * as STORAGE_PATH from '@agoric/internal/src/chain-storage-paths.js';
|
|
32
32
|
import * as ActionType from '@agoric/internal/src/action-types.js';
|
|
33
|
-
import { BridgeId
|
|
33
|
+
import { BridgeId, CosmosInitKeyToBridgeId } from '@agoric/internal';
|
|
34
34
|
import {
|
|
35
35
|
makeBufferedStorage,
|
|
36
36
|
makeReadCachingStorage,
|
|
@@ -53,6 +53,8 @@ let whenHellFreezesOver = null;
|
|
|
53
53
|
|
|
54
54
|
const TELEMETRY_SERVICE_NAME = 'agd-cosmos';
|
|
55
55
|
|
|
56
|
+
const PORT_SUFFIX = 'Port';
|
|
57
|
+
|
|
56
58
|
const toNumber = specimen => {
|
|
57
59
|
const number = parseInt(specimen, 10);
|
|
58
60
|
String(number) === String(specimen) ||
|
|
@@ -67,7 +69,7 @@ const toNumber = specimen => {
|
|
|
67
69
|
* @param {"set" | "legacySet" | "setWithoutNotify"} setterMethod
|
|
68
70
|
* @param {(value: string) => T} fromBridgeStringValue
|
|
69
71
|
* @param {(value: T) => string} toBridgeStringValue
|
|
70
|
-
* @returns {import(
|
|
72
|
+
* @returns {import('./helpers/bufferedStorage.js').KVStore<T>}
|
|
71
73
|
*/
|
|
72
74
|
const makePrefixedBridgeStorage = (
|
|
73
75
|
call,
|
|
@@ -319,12 +321,16 @@ export default async function main(progname, args, { env, homedir, agcc }) {
|
|
|
319
321
|
function doOutboundBridge(dstID, msg) {
|
|
320
322
|
const portNum = portNums[dstID];
|
|
321
323
|
if (portNum === undefined) {
|
|
324
|
+
const portKey =
|
|
325
|
+
Object.keys(CosmosInitKeyToBridgeId).find(
|
|
326
|
+
key => CosmosInitKeyToBridgeId[key] === dstID,
|
|
327
|
+
) || `${dstID}${PORT_SUFFIX}`;
|
|
322
328
|
console.error(
|
|
323
|
-
`warning: doOutboundBridge called before AG_COSMOS_INIT gave us ${
|
|
329
|
+
`warning: doOutboundBridge called before AG_COSMOS_INIT gave us ${portKey}`,
|
|
324
330
|
);
|
|
325
331
|
// it is dark, and your exception is likely to be eaten by a vat
|
|
326
332
|
throw Error(
|
|
327
|
-
`warning: doOutboundBridge called before AG_COSMOS_INIT gave us ${
|
|
333
|
+
`warning: doOutboundBridge called before AG_COSMOS_INIT gave us ${portKey}`,
|
|
328
334
|
);
|
|
329
335
|
}
|
|
330
336
|
const respStr = chainSend(portNum, stringify(msg));
|
|
@@ -336,7 +342,7 @@ export default async function main(progname, args, { env, homedir, agcc }) {
|
|
|
336
342
|
}
|
|
337
343
|
|
|
338
344
|
const toStorage = message => {
|
|
339
|
-
return doOutboundBridge(
|
|
345
|
+
return doOutboundBridge(BridgeId.STORAGE, message);
|
|
340
346
|
};
|
|
341
347
|
|
|
342
348
|
const makeInstallationPublisher = () => {
|
|
@@ -504,6 +510,7 @@ export default async function main(progname, args, { env, homedir, agcc }) {
|
|
|
504
510
|
let blockingSend;
|
|
505
511
|
|
|
506
512
|
async function handleSwingStoreExport(blockHeight, request, requestArgs) {
|
|
513
|
+
await null;
|
|
507
514
|
switch (request) {
|
|
508
515
|
case 'restore': {
|
|
509
516
|
const requestOptions =
|
|
@@ -550,7 +557,6 @@ export default async function main(progname, args, { env, homedir, agcc }) {
|
|
|
550
557
|
});
|
|
551
558
|
stateSyncExport = exportData;
|
|
552
559
|
|
|
553
|
-
// eslint-disable-next-line @jessie.js/no-nested-await
|
|
554
560
|
await new Promise((resolve, reject) => {
|
|
555
561
|
tmpfs.dir(
|
|
556
562
|
{
|
|
@@ -652,24 +658,17 @@ export default async function main(progname, args, { env, homedir, agcc }) {
|
|
|
652
658
|
|
|
653
659
|
!blockingSend || Fail`Swingset already initialized`;
|
|
654
660
|
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
if (action.vbankPort) {
|
|
668
|
-
portNums.bank = action.vbankPort;
|
|
669
|
-
}
|
|
670
|
-
|
|
671
|
-
if (action.lienPort) {
|
|
672
|
-
portNums.lien = action.lienPort;
|
|
661
|
+
for (const [key, value] of Object.entries(action)) {
|
|
662
|
+
const portAlias = CosmosInitKeyToBridgeId[key];
|
|
663
|
+
if (portAlias) {
|
|
664
|
+
// Use the alias if it exists.
|
|
665
|
+
portNums[portAlias] = value;
|
|
666
|
+
} else if (key.endsWith(PORT_SUFFIX)) {
|
|
667
|
+
// Anything else that ends in the suffix is assumed to be a port
|
|
668
|
+
// number, as described in app.go/cosmosInitAction.
|
|
669
|
+
const portName = key.slice(0, key.length - PORT_SUFFIX.length);
|
|
670
|
+
portNums[portName] = value;
|
|
671
|
+
}
|
|
673
672
|
}
|
|
674
673
|
harden(portNums);
|
|
675
674
|
|
package/src/export-kernel-db.js
CHANGED
|
@@ -12,8 +12,8 @@ import { fileURLToPath } from 'url';
|
|
|
12
12
|
|
|
13
13
|
import { makePromiseKit } from '@endo/promise-kit';
|
|
14
14
|
import { Fail, q } from '@agoric/assert';
|
|
15
|
-
import { makeAggregateError } from '@agoric/internal';
|
|
16
15
|
import { makeShutdown } from '@agoric/internal/src/node/shutdown.js';
|
|
16
|
+
import { waitUntilQuiescent } from '@agoric/internal/src/lib-nodejs/waitUntilQuiescent.js';
|
|
17
17
|
import { makeSwingStoreExporter } from '@agoric/swing-store';
|
|
18
18
|
|
|
19
19
|
import { isEntrypoint } from './helpers/is-entrypoint.js';
|
|
@@ -38,14 +38,14 @@ export const ExportManifestFileName = 'export-manifest.json';
|
|
|
38
38
|
|
|
39
39
|
/**
|
|
40
40
|
* @param {SwingStoreArtifactMode | undefined} artifactMode
|
|
41
|
-
* @returns {import(
|
|
41
|
+
* @returns {import('@agoric/swing-store').ArtifactMode}
|
|
42
42
|
*/
|
|
43
43
|
export const getEffectiveArtifactMode = artifactMode => {
|
|
44
44
|
switch (artifactMode) {
|
|
45
|
+
case undefined:
|
|
45
46
|
case 'none':
|
|
46
47
|
case 'operational':
|
|
47
48
|
return 'operational';
|
|
48
|
-
case undefined:
|
|
49
49
|
case 'replay':
|
|
50
50
|
return 'replay';
|
|
51
51
|
case 'archival':
|
|
@@ -193,6 +193,9 @@ export const initiateSwingStoreExport = (
|
|
|
193
193
|
abortIfStopped();
|
|
194
194
|
startedKit.resolve();
|
|
195
195
|
log?.(`Starting DB export at block height ${savedBlockHeight}`);
|
|
196
|
+
// Let the `started` event be sent before proceeding with blocking processing:
|
|
197
|
+
// `getArtifactNames` may block the agent for a while.
|
|
198
|
+
await waitUntilQuiescent();
|
|
196
199
|
|
|
197
200
|
/** @type {StateSyncManifest} */
|
|
198
201
|
const manifest = {
|
|
@@ -204,11 +207,9 @@ export const initiateSwingStoreExport = (
|
|
|
204
207
|
if (exportDataMode === 'all') {
|
|
205
208
|
log?.(`Writing Export Data`);
|
|
206
209
|
const fileName = `export-data.jsonl`;
|
|
207
|
-
// eslint-disable-next-line @jessie.js/no-nested-await
|
|
208
210
|
const exportDataFile = await open(pathResolve(exportDir, fileName), 'wx');
|
|
209
211
|
cleanup.push(async () => exportDataFile.close());
|
|
210
212
|
|
|
211
|
-
// eslint-disable-next-line @jessie.js/no-nested-await
|
|
212
213
|
for await (const entry of swingStoreExporter.getExportData()) {
|
|
213
214
|
await exportDataFile.write(`${JSON.stringify(entry)}\n`);
|
|
214
215
|
}
|
|
@@ -241,7 +242,7 @@ export const initiateSwingStoreExport = (
|
|
|
241
242
|
.catch(err => errors.push(err));
|
|
242
243
|
}
|
|
243
244
|
if (errors.length) {
|
|
244
|
-
const error =
|
|
245
|
+
const error = AggregateError(errors, 'Errors while cleaning up');
|
|
245
246
|
if (opErr) {
|
|
246
247
|
Object.defineProperty(error, 'cause', { value: opErr });
|
|
247
248
|
}
|
|
@@ -295,11 +296,8 @@ export const main = async (
|
|
|
295
296
|
|
|
296
297
|
const stateDir =
|
|
297
298
|
processValue.getFlag('state-dir') ||
|
|
298
|
-
// We try to find the actual cosmos state directory (default=~/.
|
|
299
|
-
`${processValue.getFlag(
|
|
300
|
-
'home',
|
|
301
|
-
`${homedir}/.ag-chain-cosmos`,
|
|
302
|
-
)}/data/agoric`;
|
|
299
|
+
// We try to find the actual cosmos state directory (default=~/.agoric)
|
|
300
|
+
`${processValue.getFlag('home', `${homedir}/.agoric`)}/data/agoric`;
|
|
303
301
|
|
|
304
302
|
const stateDirStat = await fs.stat(stateDir);
|
|
305
303
|
if (!stateDirStat.isDirectory()) {
|
package/src/import-kernel-db.js
CHANGED
|
@@ -62,7 +62,7 @@ const checkAndGetImportSwingStoreOptions = (options, manifest) => {
|
|
|
62
62
|
|
|
63
63
|
manifest.data || Fail`State-sync manifest missing export data`;
|
|
64
64
|
|
|
65
|
-
const { artifactMode = manifest.artifactMode || '
|
|
65
|
+
const { artifactMode = manifest.artifactMode || 'operational' } = options;
|
|
66
66
|
|
|
67
67
|
if (artifactMode === 'none') {
|
|
68
68
|
throw Fail`Cannot import "export data" without at least "operational" artifacts`;
|
|
@@ -247,11 +247,8 @@ export const main = async (
|
|
|
247
247
|
|
|
248
248
|
const stateDir =
|
|
249
249
|
processValue.getFlag('state-dir') ||
|
|
250
|
-
// We try to find the actual cosmos state directory (default=~/.
|
|
251
|
-
`${processValue.getFlag(
|
|
252
|
-
'home',
|
|
253
|
-
`${homedir}/.ag-chain-cosmos`,
|
|
254
|
-
)}/data/agoric`;
|
|
250
|
+
// We try to find the actual cosmos state directory (default=~/.agoric)
|
|
251
|
+
`${processValue.getFlag('home', `${homedir}/.agoric`)}/data/agoric`;
|
|
255
252
|
|
|
256
253
|
const stateDirStat = await fs.stat(stateDir);
|
|
257
254
|
if (!stateDirStat.isDirectory()) {
|
package/src/kernel-stats.js
CHANGED
|
@@ -16,8 +16,8 @@ import {
|
|
|
16
16
|
|
|
17
17
|
// diag.setLogger(new DiagConsoleLogger(), DiagLogLevel.VERBOSE);
|
|
18
18
|
|
|
19
|
-
/** @
|
|
20
|
-
/** @
|
|
19
|
+
/** @import {MetricAttributes as Attributes} from '@opentelemetry/api' */
|
|
20
|
+
/** @import {Histogram} from '@opentelemetry/api' */
|
|
21
21
|
|
|
22
22
|
import { getTelemetryProviders as getTelemetryProvidersOriginal } from '@agoric/telemetry';
|
|
23
23
|
|
package/src/launch-chain.js
CHANGED
|
@@ -1,11 +1,17 @@
|
|
|
1
1
|
// @ts-check
|
|
2
2
|
/* global process */
|
|
3
|
-
|
|
3
|
+
|
|
4
|
+
// XXX the JSON configs specify that launching the chain requires @agoric/builders,
|
|
5
|
+
// so let the JS tooling know about it by importing it here.
|
|
6
|
+
import '@agoric/builders';
|
|
7
|
+
|
|
4
8
|
import anylogger from 'anylogger';
|
|
5
9
|
|
|
6
10
|
import { E } from '@endo/far';
|
|
7
11
|
import bundleSource from '@endo/bundle-source';
|
|
8
12
|
|
|
13
|
+
/** @import {RunPolicy} from '@agoric/swingset-vat' */
|
|
14
|
+
|
|
9
15
|
import {
|
|
10
16
|
buildMailbox,
|
|
11
17
|
buildMailboxStateMap,
|
|
@@ -17,7 +23,7 @@ import {
|
|
|
17
23
|
loadBasedir,
|
|
18
24
|
loadSwingsetConfigFile,
|
|
19
25
|
} from '@agoric/swingset-vat';
|
|
20
|
-
import { waitUntilQuiescent } from '@agoric/
|
|
26
|
+
import { waitUntilQuiescent } from '@agoric/internal/src/lib-nodejs/waitUntilQuiescent.js';
|
|
21
27
|
import { assert, Fail } from '@agoric/assert';
|
|
22
28
|
import { openSwingStore } from '@agoric/swing-store';
|
|
23
29
|
import { BridgeId as BRIDGE_ID } from '@agoric/internal';
|
|
@@ -67,7 +73,7 @@ const parseUpgradePlanInfo = (upgradePlan, prefix = '') => {
|
|
|
67
73
|
return harden(upgradePlanInfo || {});
|
|
68
74
|
};
|
|
69
75
|
|
|
70
|
-
/** @
|
|
76
|
+
/** @import {SwingSetConfig} from '@agoric/swingset-vat' */
|
|
71
77
|
|
|
72
78
|
/**
|
|
73
79
|
* @typedef {object} CosmicSwingsetConfig
|
|
@@ -109,6 +115,9 @@ export async function buildSwingset(
|
|
|
109
115
|
debugName = undefined,
|
|
110
116
|
slogCallbacks,
|
|
111
117
|
slogSender,
|
|
118
|
+
verbose,
|
|
119
|
+
profileVats,
|
|
120
|
+
debugVats,
|
|
112
121
|
},
|
|
113
122
|
) {
|
|
114
123
|
const debugPrefix = debugName === undefined ? '' : `${debugName}:`;
|
|
@@ -216,6 +225,9 @@ export async function buildSwingset(
|
|
|
216
225
|
env,
|
|
217
226
|
slogCallbacks,
|
|
218
227
|
slogSender,
|
|
228
|
+
verbose,
|
|
229
|
+
profileVats,
|
|
230
|
+
debugVats,
|
|
219
231
|
},
|
|
220
232
|
);
|
|
221
233
|
|
|
@@ -232,7 +244,7 @@ export async function buildSwingset(
|
|
|
232
244
|
}
|
|
233
245
|
|
|
234
246
|
/**
|
|
235
|
-
* @typedef {
|
|
247
|
+
* @typedef {RunPolicy & {
|
|
236
248
|
* shouldRun(): boolean;
|
|
237
249
|
* remainingBeans(): bigint | undefined;
|
|
238
250
|
* totalBeans(): bigint;
|
|
@@ -614,9 +626,7 @@ export async function launch({
|
|
|
614
626
|
for await (const { action, context } of inboundQueue.consumeAll()) {
|
|
615
627
|
const inboundNum = `${context.blockHeight}-${context.txHash}-${context.msgIdx}`;
|
|
616
628
|
inboundQueueMetrics.decStat();
|
|
617
|
-
// eslint-disable-next-line no-await-in-loop
|
|
618
629
|
await performAction(action, inboundNum);
|
|
619
|
-
// eslint-disable-next-line no-await-in-loop
|
|
620
630
|
keepGoing = await runSwingset();
|
|
621
631
|
if (!keepGoing) {
|
|
622
632
|
// any leftover actions will remain on the inbound queue for possible
|
|
@@ -827,7 +837,6 @@ export async function launch({
|
|
|
827
837
|
});
|
|
828
838
|
|
|
829
839
|
for (const [meta, bundle] of Object.entries(bundles)) {
|
|
830
|
-
// eslint-disable-next-line no-await-in-loop
|
|
831
840
|
await controller
|
|
832
841
|
.validateAndInstallBundle(bundle)
|
|
833
842
|
.catch(e => Fail`Cannot validate and install ${meta}: ${e}`);
|
|
@@ -1076,6 +1085,8 @@ export async function launch({
|
|
|
1076
1085
|
controller.writeSlogObject(obj);
|
|
1077
1086
|
}
|
|
1078
1087
|
|
|
1088
|
+
console.info('Launched SwingSet kernel');
|
|
1089
|
+
|
|
1079
1090
|
return {
|
|
1080
1091
|
blockingSend,
|
|
1081
1092
|
shutdown,
|
package/src/params.js
CHANGED
|
@@ -29,7 +29,10 @@ export const encodeQueueSizes = queueSizes =>
|
|
|
29
29
|
return { key, size };
|
|
30
30
|
});
|
|
31
31
|
|
|
32
|
-
|
|
32
|
+
/**
|
|
33
|
+
* Map the SwingSet parameters to a deterministic data structure.
|
|
34
|
+
* @param {import('@agoric/cosmic-proto/swingset/swingset.js').ParamsSDKType} params
|
|
35
|
+
*/
|
|
33
36
|
export const parseParams = params => {
|
|
34
37
|
const {
|
|
35
38
|
beans_per_unit: rawBeansPerUnit,
|
package/src/sim-chain.js
CHANGED
package/src/sim-params.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
// @jessie-check
|
|
2
|
+
// @ts-check
|
|
2
3
|
|
|
3
4
|
import { Nat } from '@endo/nat';
|
|
4
5
|
|
|
5
6
|
const makeStringBeans = (key, beans) => ({ key, beans: `${Nat(beans)}` });
|
|
6
|
-
const makePowerFlagFee = (powerFlag, fee) => ({ powerFlag, fee });
|
|
7
7
|
const makeCoin = (denom, amount) => ({ denom, amount: `${Nat(amount)}` });
|
|
8
8
|
/**
|
|
9
9
|
* @param {string} key
|
|
@@ -60,10 +60,12 @@ export const defaultBeansPerUnit = [
|
|
|
60
60
|
makeStringBeans(BeansPerXsnapComputron, defaultBeansPerXsnapComputron),
|
|
61
61
|
];
|
|
62
62
|
|
|
63
|
-
const defaultBootstrapVatConfig =
|
|
63
|
+
const defaultBootstrapVatConfig =
|
|
64
|
+
'@agoric/vm-config/decentral-demo-config.json';
|
|
64
65
|
|
|
66
|
+
/** @type {import('@agoric/cosmic-proto/swingset/swingset.js').PowerFlagFeeSDKType[]} */
|
|
65
67
|
export const defaultPowerFlagFees = [
|
|
66
|
-
|
|
68
|
+
{ power_flag: 'SMART_WALLET', fee: [makeCoin('ubld', 10_000_000n)] },
|
|
67
69
|
];
|
|
68
70
|
|
|
69
71
|
export const QueueInbound = 'inbound';
|
|
@@ -74,6 +76,9 @@ export const defaultQueueMax = [
|
|
|
74
76
|
makeQueueSize(QueueInbound, defaultInboundQueueMax),
|
|
75
77
|
];
|
|
76
78
|
|
|
79
|
+
/**
|
|
80
|
+
* @type {import('@agoric/cosmic-proto/swingset/swingset.js').ParamsSDKType}
|
|
81
|
+
*/
|
|
77
82
|
export const DEFAULT_SIM_SWINGSET_PARAMS = {
|
|
78
83
|
beans_per_unit: defaultBeansPerUnit,
|
|
79
84
|
fee_unit_price: defaultFeeUnitPrice,
|
|
File without changes
|