Skip to content
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
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
2 changes: 1 addition & 1 deletion ci3/tmux_split
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ tmux new-session -d -s "$session_name" -e LOG_LEVEL=${LOG_LEVEL:-"debug"} \
-e OTEL_EXPORTER_OTLP_LOGS_ENDPOINT=${OTEL_EXPORTER_OTLP_LOGS_ENDPOINT:-} \
-e OTEL_EXPORTER_OTLP_METRICS_ENDPOINT=${OTEL_EXPORTER_OTLP_METRICS_ENDPOINT:-} \
-e OTEL_EXPORTER_OTLP_TRACES_ENDPOINT=${OTEL_EXPORTER_OTLP_TRACES_ENDPOINT:-} \
-e L1_CONSENSUS_HOST_URL=${L1_CONSENSUS_HOST_URL:-} \
-e L1_CONSENSUS_HOST_URLS=${L1_CONSENSUS_HOST_URLS:-} \
-e ETHEREUM_HOSTS=${ETHEREUM_HOSTS:-} \
-e LOG_JSON=${LOG_JSON:-}

Expand Down
10 changes: 5 additions & 5 deletions scripts/run_native_testnet.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ METRICS=false
DISABLE_BLOB_SINK=false
LOG_LEVEL="info"
ETHEREUM_HOSTS=
L1_CONSENSUS_HOST_URL=
L1_CONSENSUS_HOST_URLS=

OTEL_COLLECTOR_ENDPOINT=${OTEL_COLLECTOR_ENDPOINT:-"http://localhost:4318"}

Expand All @@ -55,7 +55,7 @@ function display_help {
echo " -c Specify the otel collector endpoint (default: $OTEL_COLLECTOR_ENDPOINT)"
echo " -b Disable the blob sink (default: false)"
echo " -e Specify the ethereum host url (default: $ETHEREUM_HOSTS)"
echo " -cl Specify the l1 consensus host url (default: $L1_CONSENSUS_HOST_URL)"
echo " -cl Specify the l1 consensus host urls (default: $L1_CONSENSUS_HOST_URLS)"
echo
echo "Example:"
echo " $0 -t ./test-4epochs.sh -val 5 -v"
Expand Down Expand Up @@ -109,7 +109,7 @@ while [[ $# -gt 0 ]]; do
shift 2
;;
-cl)
L1_CONSENSUS_HOST_URL="$2"
L1_CONSENSUS_HOST_URLS="$2"
shift 2
;;
-b)
Expand Down Expand Up @@ -138,8 +138,8 @@ fi
if [ -n "$ETHEREUM_HOSTS" ]; then
export ETHEREUM_HOSTS
fi
if [ -n "$L1_CONSENSUS_HOST_URL" ]; then
export L1_CONSENSUS_HOST_URL
if [ -n "$L1_CONSENSUS_HOST_URLS" ]; then
export L1_CONSENSUS_HOST_URLS
fi

# If an ethereum url has been provided, do not run the ethereum.sh script
Expand Down
6 changes: 3 additions & 3 deletions spartan/aztec-network/files/config/setup-service-addresses.sh
Original file line number Diff line number Diff line change
Expand Up @@ -130,9 +130,9 @@ fi

# Write addresses to file for sourcing
echo "export ETHEREUM_HOSTS=${ETHEREUM_ADDR}" >>/shared/config/service-addresses
echo "export L1_CONSENSUS_HOST_URL=${ETHEREUM_CONSENSUS_ADDR}" >>/shared/config/service-addresses
echo "export L1_CONSENSUS_HOST_API_KEY=${EXTERNAL_ETHEREUM_CONSENSUS_HOST_API_KEY}" >>/shared/config/service-addresses
echo "export L1_CONSENSUS_HOST_API_KEY_HEADER=${EXTERNAL_ETHEREUM_CONSENSUS_HOST_API_KEY_HEADER}" >>/shared/config/service-addresses
echo "export L1_CONSENSUS_HOST_URLS=${ETHEREUM_CONSENSUS_ADDR}" >>/shared/config/service-addresses
echo "export L1_CONSENSUS_HOST_API_KEYS=${EXTERNAL_ETHEREUM_CONSENSUS_HOST_API_KEY}" >>/shared/config/service-addresses
echo "export L1_CONSENSUS_HOST_API_KEY_HEADERS=${EXTERNAL_ETHEREUM_CONSENSUS_HOST_API_KEY_HEADER}" >>/shared/config/service-addresses
echo "export BOOT_NODE_HOST=${BOOT_NODE_ADDR}" >>/shared/config/service-addresses
echo "export PROVER_NODE_HOST=${PROVER_NODE_ADDR}" >>/shared/config/service-addresses
echo "export PROVER_BROKER_HOST=${PROVER_BROKER_ADDR}" >>/shared/config/service-addresses
Expand Down
17 changes: 9 additions & 8 deletions spartan/releases/testnet/aztec-sequencer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ DEFAULT_BIND_MOUNT_DIR="$HOME/aztec-data"

# unset these to avoid conflicts with the host's environment
ETHEREUM_HOSTS=
L1_CONSENSUS_HOST_URLS=
IMAGE=
BOOTNODE_URL=
LOG_LEVEL=info
Expand All @@ -42,8 +43,8 @@ parse_args() {
ETHEREUM_HOSTS="$2"
shift 2
;;
-l | --l1-consensus-host-url)
L1_CONSENSUS_HOST_URL="$2"
-l | --l1-consensus-host-urls)
L1_CONSENSUS_HOST_URLS="$2"
shift 2
;;
-p | --port)
Expand Down Expand Up @@ -150,13 +151,13 @@ configure_environment() {
done
fi

if [ -n "$L1_CONSENSUS_HOST_URL" ]; then
L1_CONSENSUS_HOST_URL="$L1_CONSENSUS_HOST_URL"
if [ -n "$L1_CONSENSUS_HOST_URLS" ]; then
L1_CONSENSUS_HOST_URLS="$L1_CONSENSUS_HOST_URLS"
else
while true; do
read -p "L1 Consensus Host URL: " L1_CONSENSUS_HOST_URL
if [ -z "$L1_CONSENSUS_HOST_URL" ]; then
echo -e "${RED}Error: L1 Consensus Host URL is required${NC}"
read -p "L1 Consensus Host URLs: " L1_CONSENSUS_HOST_URLS
if [ -z "$L1_CONSENSUS_HOST_URLS" ]; then
echo -e "${RED}Error: L1 Consensus Host URLs are required${NC}"
else
break
fi
Expand Down Expand Up @@ -260,7 +261,7 @@ PXE_PROVER_ENABLED=true
ETHEREUM_SLOT_DURATION=12
AZTEC_SLOT_DURATION=36
ETHEREUM_HOSTS=${ETHEREUM_HOSTS}
L1_CONSENSUS_HOST_URL=${L1_CONSENSUS_HOST_URL}
L1_CONSENSUS_HOST_URLS=${L1_CONSENSUS_HOST_URLS}
AZTEC_EPOCH_DURATION=32
AZTEC_PROOF_SUBMISSION_WINDOW=64
BOOTSTRAP_NODES=${BOOTSTRAP_NODES}
Expand Down
12 changes: 6 additions & 6 deletions yarn-project/archiver/src/archiver/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ export type ArchiverConfig = {
/** URL for an archiver service. If set, will return an archiver client as opposed to starting a new one. */
archiverUrl?: string;

/** URL for an L1 consensus client */
l1ConsensusHostUrl?: string;
/** List of URLS for L1 consensus clients */
l1ConsensusHostUrls?: string[];

/** The polling interval in ms for retrieving new L2 blocks and encrypted logs. */
archiverPollingIntervalMS?: number;
Expand Down Expand Up @@ -55,10 +55,10 @@ export const archiverConfigMappings: ConfigMappingsType<ArchiverConfig> = {
description:
'URL for an archiver service. If set, will return an archiver client as opposed to starting a new one.',
},
l1ConsensusHostUrl: {
env: 'L1_CONSENSUS_HOST_URL',
description: 'URL for an L1 consensus client.',
parseEnv: (val: string) => val,
l1ConsensusHostUrls: {
env: 'L1_CONSENSUS_HOST_URLS',
description: 'List of URLS for L1 consensus clients.',
parseEnv: (val: string) => val.split(',').map(url => url.trim().replace(/\/$/, '')),
},
archiverPollingIntervalMS: {
env: 'ARCHIVER_POLLING_INTERVAL_MS',
Expand Down
33 changes: 18 additions & 15 deletions yarn-project/aztec/src/cli/aztec_start_options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,9 @@ export const getOptions = (namespace: string, configMappings: Record<string, Con
// These are options used by multiple modules so should be inputted once
export const universalOptions = [
'l1RpcUrls',
'l1ConsensusHostUrl',
'l1ConsensusHostApiKey',
'l1ConsensusHostApiKeyHeader',
'l1ConsensusHostUrls',
'l1ConsensusHostApiKeys',
'l1ConsensusHostApiKeyHeaders',
'l1ChainId',
'l1Contracts',
'p2pEnabled',
Expand Down Expand Up @@ -135,23 +135,26 @@ export const aztecStartOptions: { [key: string]: AztecStartOption[] } = {
envVar: 'MNEMONIC',
},
{
flag: '--l1-consensus-host-url <value>',
description: 'URL of the Ethereum consensus node that services will connect to',
defaultValue: undefined,
envVar: 'L1_CONSENSUS_HOST_URL',
flag: '--l1-consensus-host-urls <value>',
description: 'List of URLs of the Ethereum consensus nodes that services will connect to (comma separated)',
defaultValue: [],
envVar: 'L1_CONSENSUS_HOST_URLS',
parseVal: (val: string) => val.split(',').map(url => url.trim().replace(/\/$/, '')),
},
{
flag: '--l1-consensus-host-api-key <value>',
description: 'API key for the Ethereum consensus node',
defaultValue: undefined,
envVar: 'L1_CONSENSUS_HOST_API_KEY',
flag: '--l1-consensus-host-api-keys <value>',
description: 'List of API keys for the corresponding Ethereum consensus nodes',
defaultValue: [],
envVar: 'L1_CONSENSUS_HOST_API_KEYS',
parseVal: (val: string) => val.split(',').map(url => url.trim()),
},
{
flag: '--l1-consensus-host-api-key-header <value>',
flag: '--l1-consensus-host-api-key-headers <value>',
description:
'API key header for the Ethereum consensus node. If not set, the api key will be appended to the URL as ?key=<api-key>',
defaultValue: undefined,
envVar: 'L1_CONSENSUS_HOST_API_KEY_HEADER',
'List of API key headers for the corresponding Ethereum consensus nodes. If not set, the api key for the corresponding node will be appended to the URL as ?key=<api-key>',
defaultValue: [],
envVar: 'L1_CONSENSUS_HOST_API_KEY_HEADERS',
parseVal: (val: string) => val.split(',').map(url => url.trim()),
},
],
STORAGE: [
Expand Down
2 changes: 1 addition & 1 deletion yarn-project/blob-sink/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ If no blob sink url or consensus host url is provided:
A local version of the blob sink will be used. This stores blobs in a local file system.

Blob sink url is provided:
If requesting from the blob sink, we send the blobkHash
If requesting from the blob sink, we send the blockHash

Consensus host url is provided:
If requesting from the beacon node, we send the slot number
33 changes: 18 additions & 15 deletions yarn-project/blob-sink/src/client/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,19 @@ export interface BlobSinkConfig extends BlobSinkArchiveApiConfig {
l1RpcUrls?: string[];

/**
* The URL of the L1 consensus client
* List of URLs for L1 consensus clients
*/
l1ConsensusHostUrl?: string;
l1ConsensusHostUrls?: string[];

/**
* The API key for the L1 consensus client. Added end of URL as "?key=<api-key>" unless a header is defined
* List of API keys for the corresponding L1 consensus client URLs. Added at the end of the URL as "?key=<api-key>" unless a header is defined
*/
l1ConsensusHostApiKey?: string;
l1ConsensusHostApiKeys?: string[];

/**
* The header name for the L1 consensus client API key, if needed. Added as "<api-key-header>: <api-key>"
* List of header names for the corresponding L1 consensus client API keys, if needed. Added as "<api-key-header>: <api-key>"
*/
l1ConsensusHostApiKeyHeader?: string;
l1ConsensusHostApiKeyHeaders?: string[];
}

export const blobSinkConfigMapping: ConfigMappingsType<BlobSinkConfig> = {
Expand All @@ -42,19 +42,22 @@ export const blobSinkConfigMapping: ConfigMappingsType<BlobSinkConfig> = {
description: 'List of URLs for L1 RPC Execution clients',
parseEnv: (val: string) => val.split(',').map(url => url.trim()),
},
l1ConsensusHostUrl: {
env: 'L1_CONSENSUS_HOST_URL',
description: 'The URL of the L1 consensus client',
l1ConsensusHostUrls: {
env: 'L1_CONSENSUS_HOST_URLS',
description: 'List of URLS for L1 consensus clients',
parseEnv: (val: string) => val.split(',').map(url => url.trim().replace(/\/$/, '')),
},
l1ConsensusHostApiKey: {
env: 'L1_CONSENSUS_HOST_API_KEY',
l1ConsensusHostApiKeys: {
env: 'L1_CONSENSUS_HOST_API_KEYS',
description:
'The API key for the L1 consensus client, if needed. Added end of URL as "?key=<api-key>" unless a header is defined',
'List of API keys for the corresponding L1 consensus clients, if needed. Added to the end of the corresponding URL as "?key=<api-key>" unless a header is defined',
parseEnv: (val: string) => val.split(',').map(url => url.trim()),
},
l1ConsensusHostApiKeyHeader: {
env: 'L1_CONSENSUS_HOST_API_KEY_HEADER',
l1ConsensusHostApiKeyHeaders: {
env: 'L1_CONSENSUS_HOST_API_KEY_HEADERS',
description:
'The header name for the L1 consensus client API key, if needed. Added as "<api-key-header>: <api-key>"',
'List of header names for the corresponding L1 consensus client API keys, if needed. Added to the corresponding request as "<api-key-header>: <api-key>"',
parseEnv: (val: string) => val.split(',').map(url => url.trim()),
},
...blobSinkArchiveApiConfigMappings,
};
Expand Down
6 changes: 5 additions & 1 deletion yarn-project/blob-sink/src/client/factory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@ import type { BlobSinkClientInterface } from './interface.js';
import { LocalBlobSinkClient } from './local.js';

export function createBlobSinkClient(config?: BlobSinkConfig): BlobSinkClientInterface {
if (!config?.blobSinkUrl && !config?.l1ConsensusHostUrl && !config?.archiveApiUrl) {
if (
!config?.blobSinkUrl &&
(!config?.l1ConsensusHostUrls || config?.l1ConsensusHostUrls?.length == 0) &&
!config?.archiveApiUrl
) {
const blobStore = new MemoryBlobStore();
return new LocalBlobSinkClient(blobStore);
}
Expand Down
Loading
Loading