-
Notifications
You must be signed in to change notification settings - Fork 310
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: wallet fixes for devnet, testing and misc (#8058)
## SSH agent shenanigans Fixes `aztec-wallet` TouchID + ECDSA via ssh in MacOS, which turns out to be an absolute nightmare when you put docker in the mix. Mounting the ssh-agent socket via a regular bind mount is a no-go using the latest VirtioFS driver in Mac, but the good fellows at docker provide a convenient "magic" path that should work: `/run/host-services/ssh-auth.sock` (the avid reader will probably detect the usage of the word "should" in this sentence). Of course, the socket that gets linked is not the one defined by the mostly universal `SSH_AUTH_SOCK` env variable like any sane person would assume (see docker/for-mac#4242, closed due to "inactivity", not because it's fixed!). ~~The `.ssh-hack` script takes care of that, heavily inspired by: https://evilmartians.com/chronicles/stick-with-security-yubikey-ssh-gnupg-macos. Then it turns out docker for mac doesn't respect permissions for the magical variable we just symlinked, so yet another workaround is needed (see docker/for-mac#4242 (comment) @charlielye suggested a way cleaner option using `socat`. It is now a dependency unfortunately, but it avoids a lot of pain, symlinks and general pollution of the end user's env. Basically the ssh-agent socket is redirected with socat to the host via plain old TCP, which in turn is used by the container (through the magical `host.docker.internal` name) to create yet another redirection back to a container-local UNIX socket that then gets fed to the wallet via `SSH_AUTH_SOCK`. Hooray! ## New commands - `get-alias`: retrieves the value of any stored alias. With no args, it prints a list of every alias stored in the wallet. It is also possible to filter by alias type (e.g: `aztec-wallet get-alias accounts` ## Breaking changes - Renamed `add-secret` to `create-secret` (the former made it look like the secret had to be provided) ## Misc - Hooks shell tests to CI, so a few flows are checked in every PR against the sandbox.
- Loading branch information
Showing
15 changed files
with
153 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#!/bin/bash | ||
|
||
|
||
cleanup() { | ||
kill -9 $SOCAT_PID | ||
rm -rf $SOCKET | ||
} | ||
|
||
if [[ -n "${SSH_AUTH_SOCK_SOCAT_PORT:-}" ]]; then | ||
SOCKET="$HOME/.aztec/aztec-wallet-$RANDOM.sock" | ||
socat UNIX-LISTEN:$SOCKET,fork TCP:host.docker.internal:${SSH_AUTH_SOCK_SOCAT_PORT} & | ||
SOCAT_PID=$! | ||
trap cleanup EXIT SIGKILL SIGTERM | ||
fi | ||
|
||
SSH_AUTH_SOCK="${SOCKET:-}" node --no-warnings /usr/src/yarn-project/cli-wallet/dest/bin/index.js $@ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
version: '3' | ||
services: | ||
fork: | ||
image: aztecprotocol/foundry:de33b6af53005037b463318d2628b5cfcaf39916 | ||
pull_policy: always | ||
entrypoint: > | ||
sh -c ' | ||
if [ -n "$FORK_BLOCK_NUMBER" ] && [ -n "$FORK_URL" ]; then | ||
exec anvil --silent -p 8545 --host 0.0.0.0 --chain-id 31337 --fork-url "$FORK_URL" --fork-block-number "$FORK_BLOCK_NUMBER" | ||
else | ||
exec anvil --silent -p 8545 --host 0.0.0.0 --chain-id 31337 | ||
fi' | ||
expose: | ||
- '8545' | ||
|
||
sandbox: | ||
image: aztecprotocol/aztec:${AZTEC_DOCKER_TAG:-latest} | ||
command: 'start --sandbox' | ||
environment: | ||
DEBUG: 'aztec:*' | ||
DEBUG_COLORS: 1 | ||
ETHEREUM_HOST: http://fork:8545 | ||
L1_CHAIN_ID: 31337 | ||
ARCHIVER_POLLING_INTERVAL_MS: 50 | ||
P2P_BLOCK_CHECK_INTERVAL_MS: 50 | ||
SEQ_TX_POLLING_INTERVAL_MS: 50 | ||
WS_BLOCK_CHECK_INTERVAL_MS: 50 | ||
PXE_BLOCK_POLLING_INTERVAL_MS: 50 | ||
ARCHIVER_VIEM_POLLING_INTERVAL_MS: 500 | ||
ENABLE_GAS: ${ENABLE_GAS:-} | ||
HARDWARE_CONCURRENCY: ${HARDWARE_CONCURRENCY:-} | ||
expose: | ||
- '8080' | ||
|
||
end-to-end: | ||
image: aztecprotocol/end-to-end:${AZTEC_DOCKER_TAG:-latest} | ||
environment: | ||
DEBUG: ${DEBUG:-aztec:*} | ||
DEBUG_COLORS: 1 | ||
ETHEREUM_HOST: http://fork:8545 | ||
L1_CHAIN_ID: 31337 | ||
PXE_URL: http://sandbox:8080 | ||
working_dir: /usr/src/yarn-project/cli-wallet/test | ||
entrypoint: > | ||
sh -c ' | ||
while ! nc -z sandbox 8080; do sleep 1; done; | ||
./test.sh | ||
' | ||
volumes: | ||
- ../log:/usr/src/yarn-project/end-to-end/log:rw | ||
depends_on: | ||
- sandbox | ||
- fork |