Skip to content

Commit

Permalink
A3P commands without synthetic-chain (#10396)
Browse files Browse the repository at this point in the history
closes: #10369

## Description

Many of the imports from `@agoric/synthetic-chain` are not about synthetics per se. They should be possible with the code in agoric-sdk.

This brings the new `@agoric/client-utils` into functional testing in a3p-integration. It makes the canonical source for `sync-tool.js` that was duplicated in different proposal tests.

This also demonstrates a style of smart-wallet offer execution without the `@agoric/synthetic-chain` package. See `OpenVault`. It still goes through `execSwingsetTransaction` spawning `agd` but that could also be optimized with an RPC client lib for SwingSet that does signing (see #9200). That's out of scope for this effort to simply stop reliable in another repo for testing utilities.

Review by commit is recommended

### Security Considerations
n/a, tests

### Scaling Considerations
n/a, tests

### Documentation Considerations
When these patterns stabilize more we may want to write them down. For now I think let's keep it flexible.

### Testing Considerations
per se

### Upgrade Considerations
One impact to the upgrade process is that when moving a proposal from a3p-integration to agoric-3-proposals, the dependencies may have to be updated. Though it's likely they'll work on the `/usr/src/agoric-sdk` in the image
  • Loading branch information
mergify[bot] authored Nov 8, 2024
2 parents 4b1403a + 2740748 commit bd0b2a9
Show file tree
Hide file tree
Showing 51 changed files with 1,744 additions and 1,327 deletions.
26 changes: 26 additions & 0 deletions a3p-integration/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,11 +108,37 @@ Instead of relying on an automatic `submission` folder, a core-eval proposal can

# Build details

In the `ghcr.io/agoric/agoric-sdk` image the filesystem is:
```
/usr/src/agoric-sdk
```

With the proposals layered on top of the `agoric-sdk` image, the filesystem adds (for example):
```
/usr/src/proposals/n:upgrade-next
/usr/src/proposals/z:acceptance
```

In agoric-sdk CI and development, we want the proposals to use the versions of the packages in the agoric-sdk source tree. To accomplish this we use `yarn link`. In Yarn 4 (berry) it uses a `portal` protocol to link to another Yarn project on the filesystem. One kink is that in development the command would,
```
yarn link --relative ../../.. --all
```
Which configures the package.json resolutions to find agoric-sdk three levels up.

But in CI the proposals aren't nested under agoric-sdk and the command would be,
```
yarn link --relative ../../agoric-sdk --all
```

To give a consistent location, `a3p-integration` has a symlink to the `agoric-sdk` project where the proposals expect it in the Docker fileystem. (I.e. treating `a3p-integration` as `/usr/src` of the Docker image.)


The `yarn build` script automates 3 steps:
- Building the `unreleased` SDK image
- Generating the `submission` folders in core proposal packages
- Building the synthetic-chain images using the proposals


## Generate a docker image with the `agoric-sdk` chain software

The chain software upgrade proposal contained in this end-to-end integration test performs an upgrade of the agoric-3 synthetic chain to an `UNRELEASED_A3P_INTEGRATION` plan name (or the corresponding upgrade plan name for release branches). It loads the docker image `ghcr.io/agoric/agoric-sdk:unreleased` for the software implementing that upgrade (both in the `master` branch or in release branches).
Expand Down
1 change: 1 addition & 0 deletions a3p-integration/agoric-sdk
2 changes: 1 addition & 1 deletion a3p-integration/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@
"@agoric/synthetic-chain": "^0.3.0",
"@types/better-sqlite3": "^7.6.11"
},
"packageManager": "yarn@4.2.2",
"packageManager": "yarn@4.5.1",
"license": "Apache-2.0"
}
11 changes: 7 additions & 4 deletions a3p-integration/proposals/n:upgrade-next/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@
"license": "Apache-2.0",
"dependencies": {
"@agoric/synthetic-chain": "^0.3.0",
"@endo/init": "^1.1.5",
"@endo/marshal": "^1.5.4",
"@endo/init": "^1.1.6",
"@endo/marshal": "^1.6.1",
"ava": "^5.3.1",
"better-sqlite3": "^9.6.0",
"execa": "^9.3.1"
"execa": "^9.5.1"
},
"ava": {
"concurrency": 1,
Expand All @@ -28,5 +28,8 @@
"scripts": {
"agops": "yarn --cwd /usr/src/agoric-sdk/ --silent agops"
},
"packageManager": "[email protected]"
"packageManager": "[email protected]",
"devDependencies": {
"typescript": "^5.6.3"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ const openMarginalVault = async t => {
const currentVaults = await agops.vaults('list', '--from', USER1ADDR);

t.log('opening a vault');
// @ts-expect-error bad typedef
await openVault(USER1ADDR, 5, 10);
user1IST += 5;
const istBalanceAfterVaultOpen = await getISTBalance(USER1ADDR);
Expand Down
72 changes: 0 additions & 72 deletions a3p-integration/proposals/n:upgrade-next/sync-tools.js

This file was deleted.

8 changes: 5 additions & 3 deletions a3p-integration/proposals/n:upgrade-next/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
{
"compilerOptions": {
"target": "esnext",
"module": "esnext",
"target": "ESNext",
"module": "NodeNext",
"allowJs": true,
"checkJs": true,
"strict": false,
"strictNullChecks": true,
"noEmit": true,
"noImplicitThis": true
"noImplicitThis": true,
// XXX synthetic-chain has some errors
"skipLibCheck": true
}
}
Loading

0 comments on commit bd0b2a9

Please sign in to comment.