Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Gas Utils for L1 operations #9834

Merged
merged 56 commits into from
Dec 4, 2024
Merged
Show file tree
Hide file tree
Changes from 47 commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
7dca6df
feat: Gas Utils for L1 operations
spypsy Nov 8, 2024
8a0edaa
undo irrelevant change
spypsy Nov 8, 2024
fdfc143
update some logging
spypsy Nov 8, 2024
df22c32
Merge branch 'master' into spy/gas-utils
spypsy Nov 8, 2024
347d750
add e2e test
spypsy Nov 11, 2024
d01a316
add to E2E test config
spypsy Nov 11, 2024
78f8fb2
Merge branch 'master' into spy/gas-utils
spypsy Nov 11, 2024
427c836
rm old import
spypsy Nov 11, 2024
1adc20e
small fixes
spypsy Nov 13, 2024
b481eb2
rm pk logging
spypsy Nov 13, 2024
13d731a
formatting & test issues
spypsy Nov 13, 2024
e688b8d
formatting
spypsy Nov 13, 2024
b280ed4
don't fail script when ADDRESS & pk are unset
spypsy Nov 13, 2024
58bcc71
remove logs
spypsy Nov 13, 2024
2261352
update default private_key assignment in validator.sh
spypsy Nov 13, 2024
7092327
use const for WEI
spypsy Nov 13, 2024
1b4c8c3
skip PRIVATE_KEY assignment
spypsy Nov 13, 2024
31449f7
WIP: PR fixes
spypsy Nov 14, 2024
9af92ea
Merge branch 'master' into spy/gas-utils
spypsy Nov 14, 2024
d066d51
refactor GasUtils
spypsy Nov 18, 2024
f96b1d8
simplify acc & wallets
spypsy Nov 18, 2024
e18c4f9
bump priorityFee on retries
spypsy Nov 18, 2024
f853f21
configs
spypsy Nov 18, 2024
569bf2d
Merge branch 'master' into spy/gas-utils
spypsy Nov 19, 2024
b3223d7
rename to L1TxUtils
spypsy Nov 19, 2024
47f15a4
don't use 0x
spypsy Nov 19, 2024
03fbf79
send contract deployments to null
spypsy Nov 19, 2024
280c9a7
fix publisher tests
spypsy Nov 19, 2024
0b45fe6
fix getNodeInfo test
spypsy Nov 19, 2024
bb5505b
Merge branch 'master' into spy/gas-utils
spypsy Nov 19, 2024
653a083
split sendTx & monitorTx for separate use
spypsy Nov 19, 2024
c15d6b1
calc nonce in monitor function
spypsy Nov 19, 2024
9508cb7
fix null-check
spypsy Nov 19, 2024
81c03e7
Merge branch 'master' into spy/gas-utils
spypsy Nov 20, 2024
d80ece6
remove from e2e config
spypsy Nov 20, 2024
47edcd8
temp fix integration publisher test
spypsy Nov 20, 2024
d1fa404
temp fix integration publisher test
spypsy Nov 20, 2024
09339a4
some PR fixes
spypsy Nov 21, 2024
a331d9e
use default-defined value
spypsy Nov 21, 2024
1b169b4
more PR fixes
spypsy Nov 21, 2024
8818d1f
10% min fee bump, ensure test sends replacement tx
spypsy Nov 22, 2024
60afdea
merge conflicts
spypsy Nov 22, 2024
2c4858d
Merge branch 'master' into spy/gas-utils
spypsy Nov 25, 2024
c2338d0
Merge branch 'master' into spy/gas-utils
spypsy Nov 26, 2024
34170d1
undo submodule changes
spypsy Nov 26, 2024
3d46d87
fix get-node-info opts
spypsy Nov 27, 2024
af2d3e6
requesting info from node, not pxe
spypsy Nov 27, 2024
4ab1d4b
Merge branch 'master' into spy/gas-utils
spypsy Nov 29, 2024
0834d50
More PR fixes
spypsy Nov 29, 2024
0c20390
fix await
spypsy Nov 29, 2024
5fd231b
add cheat codes
spypsy Dec 2, 2024
a17a0ae
expect two error calls
spypsy Dec 2, 2024
0c84a64
update l1-publisher tests
spypsy Dec 2, 2024
de03935
add priorityFee to maxFeePerGas calculation, retry fetching l1 tx
spypsy Dec 3, 2024
e62ba9c
fix priorityFee addition, add gas calculationt ests
spypsy Dec 4, 2024
e4cc25f
Merge branch 'master' into spy/gas-utils
spypsy Dec 4, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions spartan/aztec-network/files/config/config-prover-env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ set -eu

# Pass the bootnode url as an argument
# Ask the bootnode for l1 contract addresses
output=$(node --no-warnings /usr/src/yarn-project/aztec/dest/bin/index.js get-node-info -u $1)
output=$(node --no-warnings /usr/src/yarn-project/aztec/dest/bin/index.js get-node-info --node-url $1)

echo "$output"

Expand All @@ -20,7 +20,7 @@ governance_proposer_address=$(echo "$output" | grep -oP 'GovernanceProposer Addr
governance_address=$(echo "$output" | grep -oP 'Governance Address: \K0x[a-fA-F0-9]{40}')

# Write the addresses to a file in the shared volume
cat <<EOF > /shared/contracts/contracts.env
cat <<EOF >/shared/contracts/contracts.env
export BOOTSTRAP_NODES=$boot_node_enr
export ROLLUP_CONTRACT_ADDRESS=$rollup_address
export REGISTRY_CONTRACT_ADDRESS=$registry_address
Expand Down
6 changes: 2 additions & 4 deletions spartan/aztec-network/files/config/config-validator-env.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
#!/bin/bash
set -eu


# Pass the bootnode url as an argument
# Ask the bootnode for l1 contract addresses
output=$(node --no-warnings /usr/src/yarn-project/aztec/dest/bin/index.js get-node-info -u $1)
output=$(node --no-warnings /usr/src/yarn-project/aztec/dest/bin/index.js get-node-info --node-url $1)

echo "$output"

Expand All @@ -25,9 +24,8 @@ governance_address=$(echo "$output" | grep -oP 'Governance Address: \K0x[a-fA-F0
INDEX=$(echo $POD_NAME | awk -F'-' '{print $NF}')
private_key=$(jq -r ".[$INDEX]" /app/config/keys.json)


# Write the addresses to a file in the shared volume
cat <<EOF > /shared/contracts/contracts.env
cat <<EOF >/shared/contracts/contracts.env
export BOOTSTRAP_NODES=$boot_node_enr
export ROLLUP_CONTRACT_ADDRESS=$rollup_address
export REGISTRY_CONTRACT_ADDRESS=$registry_address
Expand Down
24 changes: 24 additions & 0 deletions yarn-project/aztec-node/src/aztec-node/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ import {
type L1_TO_L2_MSG_TREE_HEIGHT,
type NOTE_HASH_TREE_HEIGHT,
type NULLIFIER_TREE_HEIGHT,
type NodeInfo,
type NullifierLeafPreimage,
type PUBLIC_DATA_TREE_HEIGHT,
type ProtocolContractAddresses,
Expand Down Expand Up @@ -239,6 +240,29 @@ export class AztecNodeService implements AztecNode {
return Promise.resolve(this.p2pClient.isReady() ?? false);
}

public async getNodeInfo(): Promise<NodeInfo> {
const [nodeVersion, protocolVersion, chainId, enr, contractAddresses, protocolContractAddresses] =
await Promise.all([
this.getNodeVersion(),
this.getVersion(),
this.getChainId(),
this.getEncodedEnr(),
this.getL1ContractAddresses(),
this.getProtocolContractAddresses(),
]);

const nodeInfo: NodeInfo = {
nodeVersion,
l1ChainId: chainId,
protocolVersion,
enr,
l1ContractAddresses: contractAddresses,
protocolContractAddresses: protocolContractAddresses,
};

return nodeInfo;
}

/**
* Get a block specified by its number.
* @param number - The block number being requested.
Expand Down
28 changes: 28 additions & 0 deletions yarn-project/circuit-types/src/interfaces/aztec-node.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {
L1_TO_L2_MSG_TREE_HEIGHT,
NOTE_HASH_TREE_HEIGHT,
NULLIFIER_TREE_HEIGHT,
type NodeInfo,
PUBLIC_DATA_TREE_HEIGHT,
type ProtocolContractAddresses,
ProtocolContractsNames,
Expand Down Expand Up @@ -174,6 +175,19 @@ describe('AztecNodeApiSchema', () => {
expect(response).toBe(true);
});

it('getNodeInfo', async () => {
const response = await context.client.getNodeInfo();
expect(response).toEqual({
...(await handler.getNodeInfo()),
l1ContractAddresses: Object.fromEntries(
L1ContractsNames.map(name => [name, expect.any(EthAddress)]),
) as L1ContractAddresses,
protocolContractAddresses: Object.fromEntries(
ProtocolContractsNames.map(name => [name, expect.any(AztecAddress)]),
) as ProtocolContractAddresses,
});
});

it('getBlocks', async () => {
const response = await context.client.getBlocks(1, 1);
expect(response).toHaveLength(1);
Expand Down Expand Up @@ -444,6 +458,20 @@ class MockAztecNode implements AztecNode {
isReady(): Promise<boolean> {
return Promise.resolve(true);
}
getNodeInfo(): Promise<NodeInfo> {
return Promise.resolve({
nodeVersion: '1.0',
l1ChainId: 1,
protocolVersion: 1,
enr: 'enr',
l1ContractAddresses: Object.fromEntries(
L1ContractsNames.map(name => [name, EthAddress.random()]),
) as L1ContractAddresses,
protocolContractAddresses: Object.fromEntries(
ProtocolContractsNames.map(name => [name, AztecAddress.random()]),
) as ProtocolContractAddresses,
});
}
getBlocks(from: number, limit: number): Promise<L2Block[]> {
return Promise.resolve(times(limit, i => L2Block.random(from + i)));
}
Expand Down
11 changes: 11 additions & 0 deletions yarn-project/circuit-types/src/interfaces/aztec-node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ import {
L1_TO_L2_MSG_TREE_HEIGHT,
NOTE_HASH_TREE_HEIGHT,
NULLIFIER_TREE_HEIGHT,
type NodeInfo,
NodeInfoSchema,
PUBLIC_DATA_TREE_HEIGHT,
type ProtocolContractAddresses,
ProtocolContractAddressesSchema,
Expand Down Expand Up @@ -218,6 +220,13 @@ export interface AztecNode
*/
isReady(): Promise<boolean>;

/**
* Returns the information about the server's node. Includes current Node version, compatible Noir version,
* L1 chain identifier, protocol version, and L1 address of the rollup contract.
* @returns - The node information.
*/
getNodeInfo(): Promise<NodeInfo>;

/**
* Method to request blocks. Will attempt to return all requested blocks but will return only those available.
* @param from - The start of the range of blocks to return.
Expand Down Expand Up @@ -490,6 +499,8 @@ export const AztecNodeApiSchema: ApiSchemaFor<AztecNode> = {

isReady: z.function().returns(z.boolean()),

getNodeInfo: z.function().returns(NodeInfoSchema),

getBlocks: z.function().args(z.number(), z.number()).returns(z.array(L2Block.schema)),

getNodeVersion: z.function().returns(z.string()),
Expand Down
2 changes: 1 addition & 1 deletion yarn-project/cli/src/cmds/l1/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ export function injectCommands(program: Command, log: LogFn, debugLogger: DebugL
'test test test test test test test test test test test junk',
)
.addOption(l1ChainIdOption)
.option('--validator <addresse>', 'ethereum address of the validator', parseEthereumAddress)
.option('--validator <address>', 'ethereum address of the validator', parseEthereumAddress)
.option('--rollup <address>', 'ethereum address of the rollup contract', parseEthereumAddress)
.action(async options => {
const { removeL1Validator } = await import('./update_l1_validators.js');
Expand Down
17 changes: 13 additions & 4 deletions yarn-project/cli/src/cmds/l1/update_l1_validators.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { EthCheatCodes } from '@aztec/aztec.js';
import { type EthAddress } from '@aztec/circuits.js';
import { createEthereumChain, getL1ContractsConfigEnvVars } from '@aztec/ethereum';
import { createEthereumChain, getL1ContractsConfigEnvVars, isAnvilTestChain } from '@aztec/ethereum';
import { type DebugLogger, type LogFn } from '@aztec/foundation/log';
import { RollupAbi } from '@aztec/l1-artifacts';

Expand Down Expand Up @@ -53,9 +53,18 @@ export async function addL1Validator({
const txHash = await rollup.write.addValidator([validatorAddress.toString()]);
dualLog(`Transaction hash: ${txHash}`);
await publicClient.waitForTransactionReceipt({ hash: txHash });
dualLog(`Funding validator on L1`);
const cheatCodes = new EthCheatCodes(rpcUrl, debugLogger);
await cheatCodes.setBalance(validatorAddress, 10n ** 20n);
if (isAnvilTestChain(chainId)) {
dualLog(`Funding validator on L1`);
const cheatCodes = new EthCheatCodes(rpcUrl, debugLogger);
await cheatCodes.setBalance(validatorAddress, 10n ** 20n);
} else {
const balance = await publicClient.getBalance({ address: validatorAddress.toString() });
const balanceInEth = Number(balance) / 10 ** 18;
dualLog(`Validator balance: ${balanceInEth.toFixed(6)} ETH`);
if (balanceInEth === 0) {
dualLog(`WARNING: Validator has no balance. Remember to fund it!`);
}
}
}

export async function removeL1Validator({
Expand Down
11 changes: 8 additions & 3 deletions yarn-project/cli/src/cmds/pxe/get_node_info.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
import { createCompatibleClient } from '@aztec/aztec.js';
import { type AztecNode, type PXE, createAztecNodeClient, createCompatibleClient } from '@aztec/aztec.js';
import { type DebugLogger, type LogFn } from '@aztec/foundation/log';

export async function getNodeInfo(rpcUrl: string, debugLogger: DebugLogger, log: LogFn) {
const client = await createCompatibleClient(rpcUrl, debugLogger);
export async function getNodeInfo(rpcUrl: string, pxeRequest: boolean, debugLogger: DebugLogger, log: LogFn) {
let client: AztecNode | PXE;
if (pxeRequest) {
client = await createCompatibleClient(rpcUrl, debugLogger);
} else {
client = createAztecNodeClient(rpcUrl);
}
const info = await client.getNodeInfo();
log(`Node Version: ${info.nodeVersion}`);
log(`Chain Id: ${info.l1ChainId}`);
Expand Down
15 changes: 12 additions & 3 deletions yarn-project/cli/src/cmds/pxe/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ import { type DebugLogger, type LogFn } from '@aztec/foundation/log';
import { type Command } from 'commander';

import {
LOCALHOST,
logJson,
makePxeOption,
parseAztecAddress,
parseEthereumAddress,
parseField,
Expand Down Expand Up @@ -133,11 +135,18 @@ export function injectCommands(program: Command, log: LogFn, debugLogger: DebugL

program
.command('get-node-info')
.description('Gets the information of an aztec node at a URL.')
.addOption(pxeOption)
.description('Gets the information of an Aztec node from a PXE or directly from an Aztec node.')
.option('--node-url <string>', 'URL of the node.', `http://${LOCALHOST}:8080`)
.addOption(makePxeOption(false))
.action(async options => {
const { getNodeInfo } = await import('./get_node_info.js');
await getNodeInfo(options.rpcUrl, debugLogger, log);
let url: string;
if (options.nodeUrl) {
url = options.nodeUrl;
} else {
url = options.rpcUrl;
}
await getNodeInfo(url, !options.nodeUrl, debugLogger, log);
});

program
Expand Down
8 changes: 4 additions & 4 deletions yarn-project/end-to-end/scripts/native-network/boot-node.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ exec > >(tee -a "$(dirname $0)/logs/${SCRIPT_NAME}.log") 2> >(tee -a "$(dirname
export PORT=${PORT:-"8080"}
export DEBUG=${DEBUG:-"aztec:*,-aztec:avm_simulator*,-aztec:libp2p_service*,-aztec:circuits:artifact_hash,-json-rpc*,-aztec:l2_block_stream,-aztec:world-state:*"}
export LOG_LEVEL=${LOG_LEVEL:-"debug"}
export ETHEREUM_HOST="http://127.0.0.1:8545"
export ETHEREUM_HOST=${ETHEREUM_HOST:-"http://127.0.0.1:8545"}
export P2P_ENABLED="true"
export VALIDATOR_DISABLED="true"
export SEQ_MAX_SECONDS_BETWEEN_BLOCKS="0"
Expand All @@ -26,11 +26,11 @@ export OTEL_EXPORTER_OTLP_METRICS_ENDPOINT="${OTEL_EXPORTER_OTLP_METRICS_ENDPOIN
export OTEL_EXPORTER_OTLP_TRACES_ENDPOINT="${OTEL_EXPORTER_OTLP_TRACES_ENDPOINT:-}"
export OTEL_EXPORTER_OTLP_LOGS_ENDPOINT="${OTEL_EXPORTER_OTLP_LOGS_ENDPOINT:-}"
export OTEL_RESOURCE_ATTRIBUTES="service.name=boot-node"
export VALIDATOR_PRIVATE_KEY="0x47e179ec197488593b187f80a00eb0da91f1b9d0b13f8733639f19c30a34926a"
export VALIDATOR_PRIVATE_KEY=${VALIDATOR_PRIVATE_KEY:-"0x47e179ec197488593b187f80a00eb0da91f1b9d0b13f8733639f19c30a34926a"}
REPO=$(git rev-parse --show-toplevel)

echo "Waiting for l1 contracts to be deployed..."
until [ -f "$REPO"/yarn-project/end-to-end/scripts/native-network/state/l1-contracts.env ] ; do
until [ -f "$REPO"/yarn-project/end-to-end/scripts/native-network/state/l1-contracts.env ]; do
sleep 1
done
echo "Done waiting."
Expand All @@ -42,4 +42,4 @@ function filter_noise() {
}

# Start the Aztec node with the sequencer and archiver
node --no-warnings "$REPO"/yarn-project/aztec/dest/bin/index.js start --node --archiver --sequencer --pxe 2>&1 | filter_noise
spalladino marked this conversation as resolved.
Show resolved Hide resolved
node --no-warnings "$REPO"/yarn-project/aztec/dest/bin/index.js start --node --archiver --sequencer 2>&1 | filter_noise
Original file line number Diff line number Diff line change
Expand Up @@ -18,21 +18,33 @@ else
INIT_VALIDATORS="false"
fi

echo "Waiting for Anvil to be up at port 8545..."
export ETHEREUM_HOST=${ETHEREUM_HOST:-"http://127.0.0.1:8545"}
export L1_CHAIN_ID=${L1_CHAIN_ID:-"31337"}
export PRIVATE_KEY=${PRIVATE_KEY:-""}
export SALT=${SALT:-"1337"}

echo "Waiting for Ethereum node to be up..."
until curl -s -X POST -H 'Content-Type: application/json' \
--data '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":1}' \
http://127.0.0.1:8545 2>/dev/null | grep -q 'result' ; do
$ETHEREUM_HOST 2>/dev/null | grep -q 'result'; do
sleep 1
done
echo "Done waiting."

# Run the deploy-l1-contracts command and capture the output
export ETHEREUM_HOST="http://127.0.0.1:8545"
if [ "$INIT_VALIDATORS" = "true" ]; then
output=$(node --no-warnings $(git rev-parse --show-toplevel)/yarn-project/aztec/dest/bin/index.js deploy-l1-contracts --validators "$VALIDATOR_ADDRESSES" --salt 1337)
else
output=$(node --no-warnings $(git rev-parse --show-toplevel)/yarn-project/aztec/dest/bin/index.js deploy-l1-contracts --salt 1337)
fi
# Construct base command
COMMAND="node --no-warnings $(git rev-parse --show-toplevel)/yarn-project/aztec/dest/bin/index.js \
deploy-l1-contracts \
--rpc-url $ETHEREUM_HOST \
--l1-chain-id $L1_CHAIN_ID \
--salt $SALT"

# Add validators if specified
[ "$INIT_VALIDATORS" = "true" ] && COMMAND="$COMMAND --validators $VALIDATOR_ADDRESSES"

# Add private key if provided
[ -n "$PRIVATE_KEY" ] && COMMAND="$COMMAND --private-key $PRIVATE_KEY"

output=$($COMMAND)

echo "$output"

Expand All @@ -48,9 +60,8 @@ REWARD_DISTRIBUTOR_CONTRACT_ADDRESS=$(echo "$output" | grep -oP 'RewardDistribut
GOVERNANCE_PROPOSER_CONTRACT_ADDRESS=$(echo "$output" | grep -oP 'GovernanceProposer Address: \K0x[a-fA-F0-9]{40}')
GOVERNANCE_CONTRACT_ADDRESS=$(echo "$output" | grep -oP 'Governance Address: \K0x[a-fA-F0-9]{40}')


# Save contract addresses to state/l1-contracts.env
cat << EOCONFIG > $(git rev-parse --show-toplevel)/yarn-project/end-to-end/scripts/native-network/state/l1-contracts.env
cat <<EOCONFIG >$(git rev-parse --show-toplevel)/yarn-project/end-to-end/scripts/native-network/state/l1-contracts.env
export ROLLUP_CONTRACT_ADDRESS=$ROLLUP_CONTRACT_ADDRESS
export REGISTRY_CONTRACT_ADDRESS=$REGISTRY_CONTRACT_ADDRESS
export INBOX_CONTRACT_ADDRESS=$INBOX_CONTRACT_ADDRESS
Expand Down
10 changes: 5 additions & 5 deletions yarn-project/end-to-end/scripts/native-network/prover-node.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,29 +14,29 @@ exec > >(tee -a "$(dirname $0)/logs/${SCRIPT_NAME}.log") 2> >(tee -a "$(dirname
REPO=$(git rev-parse --show-toplevel)

echo "Waiting for l1 contracts to be deployed..."
until [ -f "$REPO"/yarn-project/end-to-end/scripts/native-network/state/l1-contracts.env ] ; do
until [ -f "$REPO"/yarn-project/end-to-end/scripts/native-network/state/l1-contracts.env ]; do
sleep 1
done
echo "Waiting for Aztec Node..."
until curl -s http://127.0.0.1:8080/status >/dev/null ; do
until curl -s http://127.0.0.1:8080/status >/dev/null; do
sleep 1
done
echo "Done waiting."

source "$REPO"/yarn-project/end-to-end/scripts/native-network/state/l1-contracts.env

# Get node info from the boot node
output=$(node --no-warnings "$REPO"/yarn-project/aztec/dest/bin/index.js get-node-info -u http://127.0.0.1:8080)
output=$(node --no-warnings "$REPO"/yarn-project/aztec/dest/bin/index.js get-node-info --node-url http://127.0.0.1:8080)

# Extract boot node ENR
export BOOTSTRAP_NODES=$(echo "$output" | grep -oP 'Node ENR: \K.*')

# Set environment variables
export LOG_LEVEL=${LOG_LEVEL:-"debug"}
export DEBUG=${DEBUG:-"aztec:*,-aztec:avm_simulator*,-aztec:libp2p_service*,-aztec:circuits:artifact_hash,-json-rpc*,-aztec:l2_block_stream,-aztec:world-state:*"}
export ETHEREUM_HOST="http://127.0.0.1:8545"
export ETHEREUM_HOST=${ETHEREUM_HOST:-"http://127.0.0.1:8545"}
export PROVER_AGENT_ENABLED="true"
export PROVER_PUBLISHER_PRIVATE_KEY="0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80"
export PROVER_PUBLISHER_PRIVATE_KEY=${PROVER_PUBLISHER_PRIVATE_KEY:-"0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80"}
export PROVER_COORDINATION_NODE_URL="http://127.0.0.1:8080"
export AZTEC_NODE_URL="http://127.0.0.1:8080"
export PROVER_JOB_SOURCE_URL="http://127.0.0.1:$PORT"
Expand Down
11 changes: 6 additions & 5 deletions yarn-project/end-to-end/scripts/native-network/pxe.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,20 @@ exec > >(tee -a "$(dirname $0)/logs/${SCRIPT_NAME}.log") 2> >(tee -a "$(dirname

# Starts the PXE (Private eXecution Environment) service
# Set environment variables
export ETHEREUM_HOST="http://127.0.0.1:8545"
export AZTEC_NODE_URL="http://127.0.0.1:8080"
export ETHEREUM_HOST=${ETHEREUM_HOST:-"http://127.0.0.1:8545"}
export AZTEC_NODE_URL=${AZTEC_NODE_URL:-"http://127.0.0.1:8080"}
export VALIDATOR_NODE_URL=${VALIDATOR_NODE_URL:-"http://127.0.0.1:8081"}
export LOG_LEVEL=${LOG_LEVEL:-"debug"}
export DEBUG="aztec:*"

echo "Waiting for Aztec Node..."
until curl -s http://127.0.0.1:8080/status >/dev/null ; do
until curl -s $AZTEC_NODE_URL/status >/dev/null; do
sleep 1
done
# We need to also wait for the validator, as the initial node cannot
# Produce blocks on it's own
echo "Waiting for Validator 0..."
until curl -s http://127.0.0.1:8081/status >/dev/null ; do
until curl -s $VALIDATOR_NODE_URL/status >/dev/null; do
sleep 1
done
echo "Done waiting."
Expand All @@ -31,4 +32,4 @@ function filter_noise() {
}

# Start the PXE service
node --no-warnings $(git rev-parse --show-toplevel)/yarn-project/aztec/dest/bin/index.js start --port=8079 --pxe 2>&1 | filter_noise
node --no-warnings $(git rev-parse --show-toplevel)/yarn-project/aztec/dest/bin/index.js start --port=8079 --pxe 2>&1 | filter_noise
Loading
Loading