Skip to content

Commit ac6b6e8

Browse files
authoredJan 31, 2025
chore: rc-2 update & beacon node fix for sepolia (#11631)
1 parent ab8b5db commit ac6b6e8

File tree

12 files changed

+137
-15
lines changed

12 files changed

+137
-15
lines changed
 

‎.github/workflows/network-deploy.yml

+14-3
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,9 @@ jobs:
115115
REGION: us-west1-a
116116
TF_STATE_BUCKET: aztec-terraform
117117
GKE_CLUSTER_CONTEXT: "gke_testnet-440309_us-west1-a_${{ inputs.cluster }}"
118+
GCP_API_KEY_HEADER: "X-goog-api-key"
119+
EXTERNAL_ETHEREUM_HOST: "https://json-rpc.${{ secrets.SEPOLIA_EXTERNAL_HOST }}"
120+
EXTERNAL_ETHEREUM_CONSENSUS_HOST: "https://beacon.${{ secrets.SEPOLIA_EXTERNAL_HOST }}"
118121

119122
steps:
120123
- name: Checkout code
@@ -150,12 +153,14 @@ jobs:
150153
151154
- name: Grab the boot node deployment mnemonic
152155
id: get-mnemonic
156+
if: ${{ inputs.sepolia_deployment != 'true' }}
153157
run: |
154158
echo "::add-mask::$(gcloud secrets versions access latest --secret=${{ env.DEPLOYMENT_MNEMONIC_SECRET_NAME }})"
155159
echo "mnemonic=$(gcloud secrets versions access latest --secret=${{ env.DEPLOYMENT_MNEMONIC_SECRET_NAME }})" >> "$GITHUB_OUTPUT"
156160
157161
- name: Generate eth devnet config
158162
id: generate-eth-devnet-config
163+
if: ${{ inputs.sepolia_deployment != 'true' }}
159164
run: |
160165
REPO=$(git rev-parse --show-toplevel)
161166
@@ -191,8 +196,11 @@ jobs:
191196
-var="VALIDATOR_KEYS=${{ secrets.SEPOLIA_VALIDATOR_KEYS }}" \
192197
-var="BOOT_NODE_SEQ_PUBLISHER_PRIVATE_KEY=${{ secrets.SEPOLIA_BOOT_NODE_SEQ_PUBLISHER_PRIVATE_KEY }}" \
193198
-var="PROVER_PUBLISHER_PRIVATE_KEY=${{ secrets.SEPOLIA_PROVER_PUBLISHER_PRIVATE_KEY }}" \
194-
-var="ETHEREUM_EXTERNAL_HOST=${{ secrets.SEPOLIA_EXTERNAL_HOST }}" \
195-
-lock=${{ inputs.respect_tf_lock }}
199+
-var="EXTERNAL_ETHEREUM_HOST=${{ env.EXTERNAL_ETHEREUM_HOST }}?key=${{ secrets.SEPOLIA_API_KEY }}" \
200+
-var="EXTERNAL_ETHEREUM_CONSENSUS_HOST=${{ env.EXTERNAL_ETHEREUM_CONSENSUS_HOST }}" \
201+
-var="EXTERNAL_ETHEREUM_CONSENSUS_HOST_API_KEY=${{ secrets.SEPOLIA_API_KEY }}" \
202+
-var="EXTERNAL_ETHEREUM_CONSENSUS_HOST_API_KEY_HEADER=${{ env.GCP_API_KEY_HEADER }}" \
203+
-lock=${{ inputs.respect_tf_lock }}
196204
else
197205
terraform destroy -auto-approve \
198206
-var="RELEASE_NAME=${{ env.NAMESPACE }}" \
@@ -217,7 +225,10 @@ jobs:
217225
-var="VALIDATOR_KEYS=${{ secrets.SEPOLIA_VALIDATOR_KEYS }}" \
218226
-var="BOOT_NODE_SEQ_PUBLISHER_PRIVATE_KEY=${{ secrets.SEPOLIA_BOOT_NODE_SEQ_PUBLISHER_PRIVATE_KEY }}" \
219227
-var="PROVER_PUBLISHER_PRIVATE_KEY=${{ secrets.SEPOLIA_PROVER_PUBLISHER_PRIVATE_KEY }}" \
220-
-var="ETHEREUM_EXTERNAL_HOST=${{ secrets.SEPOLIA_EXTERNAL_HOST }}" \
228+
-var="EXTERNAL_ETHEREUM_HOST=${{ env.EXTERNAL_ETHEREUM_HOST }}?key=${{ secrets.SEPOLIA_API_KEY }}" \
229+
-var="EXTERNAL_ETHEREUM_CONSENSUS_HOST=${{ env.EXTERNAL_ETHEREUM_CONSENSUS_HOST }}" \
230+
-var="EXTERNAL_ETHEREUM_CONSENSUS_HOST_API_KEY=${{ secrets.SEPOLIA_API_KEY }}" \
231+
-var="EXTERNAL_ETHEREUM_CONSENSUS_HOST_API_KEY_HEADER=${{ env.GCP_API_KEY_HEADER }}" \
221232
-out=tfplan \
222233
-lock=${{ inputs.respect_tf_lock }}
223234
else

‎spartan/aztec-network/files/config/setup-service-addresses.sh

+2
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,8 @@ fi
131131
# Write addresses to file for sourcing
132132
echo "export ETHEREUM_HOST=${ETHEREUM_ADDR}" >> /shared/config/service-addresses
133133
echo "export L1_CONSENSUS_HOST_URL=${ETHEREUM_CONSENSUS_ADDR}" >> /shared/config/service-addresses
134+
echo "export L1_CONSENSUS_HOST_API_KEY=${EXTERNAL_ETHEREUM_CONSENSUS_HOST_API_KEY}" >> /shared/config/service-addresses
135+
echo "export L1_CONSENSUS_HOST_API_KEY_HEADER=${EXTERNAL_ETHEREUM_CONSENSUS_HOST_API_KEY_HEADER}" >> /shared/config/service-addresses
134136
echo "export BOOT_NODE_HOST=${BOOT_NODE_ADDR}" >> /shared/config/service-addresses
135137
echo "export PROVER_NODE_HOST=${PROVER_NODE_ADDR}" >> /shared/config/service-addresses
136138
echo "export PROVER_BROKER_HOST=${PROVER_BROKER_ADDR}" >> /shared/config/service-addresses

‎spartan/aztec-network/templates/_helpers.tpl

+4
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,10 @@ Service Address Setup Container
147147
value: "{{ .Values.ethereum.execution.service.port }}"
148148
- name: EXTERNAL_ETHEREUM_CONSENSUS_HOST
149149
value: "{{ .Values.ethereum.beacon.externalHost }}"
150+
- name: EXTERNAL_ETHEREUM_CONSENSUS_HOST_API_KEY
151+
value: "{{ .Values.ethereum.beacon.apiKey }}"
152+
- name: EXTERNAL_ETHEREUM_CONSENSUS_HOST_API_KEY_HEADER
153+
value: "{{ .Values.ethereum.beacon.apiKeyHeader }}"
150154
- name: ETHEREUM_CONSENSUS_PORT
151155
value: "{{ .Values.ethereum.beacon.service.port }}"
152156
- name: EXTERNAL_BOOT_NODE_HOST

‎spartan/aztec-network/values.yaml

+3
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,9 @@ ethereum:
239239
cpu: "1"
240240
storageSize: "80Gi"
241241
beacon:
242+
externalHost: ""
243+
apiKey: ""
244+
apiKeyHeader: ""
242245
service:
243246
port: 5052
244247
targetPort: 5052

‎spartan/aztec-network/values/rc-2.yaml

+5-1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@ ethereum:
1818
chainId: "11155111"
1919
deployL1ContractsPrivateKey:
2020
externalHost:
21+
beacon:
22+
externalHost:
23+
apiKey: ""
24+
apiKeyHeader: ""
2125

2226
validator:
2327
l1FixedPriorityFeePerGas: 2
@@ -101,7 +105,7 @@ proverAgent:
101105

102106
bot:
103107
replicas: 4
104-
followChain: "PENDING"
108+
followChain: "NONE"
105109
enabled: true
106110
txIntervalSeconds: 0
107111
privateTransfersPerTx: 1

‎spartan/aztec-network/values/sepolia-48-validators-with-proving-and-metrics.yaml

+6-2
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,16 @@ images:
1212

1313
network:
1414
setupL2Contracts: false
15-
public: false
15+
public: true
1616

1717
ethereum:
1818
chainId: "11155111"
1919
deployL1ContractsPrivateKey:
2020
externalHost:
21+
beacon:
22+
externalHost:
23+
apiKey: ""
24+
apiKeyHeader: ""
2125

2226
validator:
2327
l1FixedPriorityFeePerGas: 2
@@ -101,7 +105,7 @@ proverAgent:
101105

102106
bot:
103107
replicas: 4
104-
followChain: "PENDING"
108+
followChain: "NONE"
105109
enabled: true
106110
txIntervalSeconds: 0
107111
privateTransfersPerTx: 1

‎spartan/terraform/deploy-release/main.tf

+26-2
Original file line numberDiff line numberDiff line change
@@ -88,10 +88,34 @@ resource "helm_release" "aztec-gke-cluster" {
8888
}
8989

9090
dynamic "set" {
91-
for_each = var.ETHEREUM_EXTERNAL_HOST != "" ? toset(["iterate"]) : toset([])
91+
for_each = var.EXTERNAL_ETHEREUM_HOST != "" ? toset(["iterate"]) : toset([])
9292
content {
9393
name = "ethereum.externalHost"
94-
value = var.ETHEREUM_EXTERNAL_HOST
94+
value = var.EXTERNAL_ETHEREUM_HOST
95+
}
96+
}
97+
98+
dynamic "set" {
99+
for_each = var.EXTERNAL_ETHEREUM_CONSENSUS_HOST != "" ? toset(["iterate"]) : toset([])
100+
content {
101+
name = "ethereum.beacon.externalHost"
102+
value = var.EXTERNAL_ETHEREUM_CONSENSUS_HOST
103+
}
104+
}
105+
106+
dynamic "set" {
107+
for_each = var.EXTERNAL_ETHEREUM_CONSENSUS_HOST_API_KEY != "" ? toset(["iterate"]) : toset([])
108+
content {
109+
name = "ethereum.beacon.apiKey"
110+
value = var.EXTERNAL_ETHEREUM_CONSENSUS_HOST_API_KEY
111+
}
112+
}
113+
114+
dynamic "set" {
115+
for_each = var.EXTERNAL_ETHEREUM_CONSENSUS_HOST_API_KEY_HEADER != "" ? toset(["iterate"]) : toset([])
116+
content {
117+
name = "ethereum.beacon.apiKeyHeader"
118+
value = var.EXTERNAL_ETHEREUM_CONSENSUS_HOST_API_KEY_HEADER
95119
}
96120
}
97121

‎spartan/terraform/deploy-release/variables.tf

+20-1
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,30 @@ variable "PROVER_PUBLISHER_PRIVATE_KEY" {
5454
default = ""
5555
}
5656

57-
variable "ETHEREUM_EXTERNAL_HOST" {
57+
variable "EXTERNAL_ETHEREUM_HOST" {
5858
description = "External host to use for the ethereum node"
5959
type = string
6060
default = ""
6161
}
62+
63+
variable "EXTERNAL_ETHEREUM_CONSENSUS_HOST" {
64+
description = "External host to use for the ethereum consensus node"
65+
type = string
66+
default = ""
67+
}
68+
69+
variable "EXTERNAL_ETHEREUM_CONSENSUS_HOST_API_KEY" {
70+
description = "API key to use for the ethereum consensus node"
71+
type = string
72+
default = ""
73+
}
74+
75+
variable "EXTERNAL_ETHEREUM_CONSENSUS_HOST_API_KEY_HEADER" {
76+
description = "API key header to use for the ethereum consensus node"
77+
type = string
78+
default = ""
79+
}
80+
6281
variable "L1_DEPLOYMENT_SALT" {
6382
description = "Salt to use for the L1 contract deployments"
6483
type = string

‎yarn-project/aztec-node/src/aztec-node/config.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { type ArchiverConfig, archiverConfigMappings } from '@aztec/archiver/config';
2-
import { type BlobSinkConfig } from '@aztec/blob-sink/client';
2+
import { type BlobSinkConfig, blobSinkConfigMapping } from '@aztec/blob-sink/client';
33
import { type ConfigMappingsType, booleanConfigHelper, getConfigFromMappings } from '@aztec/foundation/config';
44
import { type DataStoreConfig, dataConfigMappings } from '@aztec/kv-store/config';
55
import { type P2PConfig, p2pConfigMappings } from '@aztec/p2p/config';
@@ -37,6 +37,7 @@ export const aztecNodeConfigMappings: ConfigMappingsType<AztecNodeConfig> = {
3737
...worldStateConfigMappings,
3838
...p2pConfigMappings,
3939
...dataConfigMappings,
40+
...blobSinkConfigMapping,
4041
disableValidator: {
4142
env: 'VALIDATOR_DISABLED',
4243
description: 'Whether the validator is disabled for this node.',

‎yarn-project/blob-sink/src/client/config.ts

+20
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,16 @@ export interface BlobSinkConfig {
1818
* The URL of the L1 consensus client
1919
*/
2020
l1ConsensusHostUrl?: string;
21+
22+
/**
23+
* The API key for the L1 consensus client. Added end of URL as "?key=<api-key>" unless a header is defined
24+
*/
25+
l1ConsensusHostApiKey?: string;
26+
27+
/**
28+
* The header name for the L1 consensus client API key, if needed. Added as "<api-key-header>: <api-key>"
29+
*/
30+
l1ConsensusHostApiKeyHeader?: string;
2131
}
2232

2333
export const blobSinkConfigMapping: ConfigMappingsType<BlobSinkConfig> = {
@@ -33,6 +43,16 @@ export const blobSinkConfigMapping: ConfigMappingsType<BlobSinkConfig> = {
3343
env: 'L1_CONSENSUS_HOST_URL',
3444
description: 'The URL of the L1 consensus client',
3545
},
46+
l1ConsensusHostApiKey: {
47+
env: 'L1_CONSENSUS_HOST_API_KEY',
48+
description:
49+
'The API key for the L1 consensus client, if needed. Added end of URL as "?key=<api-key>" unless a header is defined',
50+
},
51+
l1ConsensusHostApiKeyHeader: {
52+
env: 'L1_CONSENSUS_HOST_API_KEY_HEADER',
53+
description:
54+
'The header name for the L1 consensus client API key, if needed. Added as "<api-key-header>: <api-key>"',
55+
},
3656
};
3757

3858
/**

‎yarn-project/blob-sink/src/client/http.ts

+33-5
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,10 @@ export class HttpBlobSinkClient implements BlobSinkClientInterface {
8080

8181
if (blobs.length == 0 && this.config.l1ConsensusHostUrl) {
8282
// The beacon api can query by slot number, so we get that first
83-
this.log.debug('Getting slot number from consensus host');
83+
this.log.debug('Getting slot number from consensus host', {
84+
blockHash,
85+
consensusHostUrl: this.config.l1ConsensusHostUrl,
86+
});
8487
const slotNumber = await this.getSlotNumber(blockHash);
8588
if (slotNumber) {
8689
const blobs = await this.getBlobSidecarFrom(this.config.l1ConsensusHostUrl, slotNumber, indices);
@@ -106,12 +109,16 @@ export class HttpBlobSinkClient implements BlobSinkClientInterface {
106109
): Promise<Blob[]> {
107110
// TODO(md): right now we assume all blobs are ours, this will not yet work on sepolia
108111
try {
109-
let url = `${hostUrl}/eth/v1/beacon/blob_sidecars/${blockHashOrSlot}`;
112+
let baseUrl = `${hostUrl}/eth/v1/beacon/blob_sidecars/${blockHashOrSlot}`;
110113
if (indices && indices.length > 0) {
111-
url += `?indices=${indices.join(',')}`;
114+
baseUrl += `?indices=${indices.join(',')}`;
112115
}
113116

114-
const res = await this.fetch(url);
117+
const { url, ...options } = getBeaconNodeFetchOptions(baseUrl, this.config);
118+
119+
this.log.debug(`Fetching blob sidecar from ${url} with options`, options);
120+
121+
const res = await this.fetch(url, options);
115122

116123
if (res.ok) {
117124
const body = await res.json();
@@ -183,7 +190,12 @@ export class HttpBlobSinkClient implements BlobSinkClientInterface {
183190

184191
// Query beacon chain to get the slot number for that block root
185192
try {
186-
const res = await this.fetch(`${this.config.l1ConsensusHostUrl}/eth/v1/beacon/headers/${parentBeaconBlockRoot}`);
193+
const { url, ...options } = getBeaconNodeFetchOptions(
194+
`${this.config.l1ConsensusHostUrl}/eth/v1/beacon/headers/${parentBeaconBlockRoot}`,
195+
this.config,
196+
);
197+
const res = await this.fetch(url, options);
198+
187199
if (res.ok) {
188200
const body = await res.json();
189201

@@ -210,3 +222,19 @@ function filterRelevantBlobs(blobs: Blob[], blobHashes: Buffer[]): Blob[] {
210222
return blobHashes.some(hash => hash.equals(blobHash));
211223
});
212224
}
225+
226+
function getBeaconNodeFetchOptions(url: string, config: BlobSinkConfig) {
227+
let formattedUrl = url;
228+
if (config.l1ConsensusHostApiKey && !config.l1ConsensusHostApiKeyHeader) {
229+
formattedUrl += `${formattedUrl.includes('?') ? '&' : '?'}key=${config.l1ConsensusHostApiKey}`;
230+
}
231+
return {
232+
url: formattedUrl,
233+
...(config.l1ConsensusHostApiKey &&
234+
config.l1ConsensusHostApiKeyHeader && {
235+
headers: {
236+
[config.l1ConsensusHostApiKeyHeader]: config.l1ConsensusHostApiKey,
237+
},
238+
}),
239+
};
240+
}

‎yarn-project/foundation/src/config/env_var.ts

+2
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@ export type EnvVar =
5454
| 'INBOX_CONTRACT_ADDRESS'
5555
| 'L1_CHAIN_ID'
5656
| 'L1_CONSENSUS_HOST_URL'
57+
| 'L1_CONSENSUS_HOST_API_KEY'
58+
| 'L1_CONSENSUS_HOST_API_KEY_HEADER'
5759
| 'L1_PRIVATE_KEY'
5860
| 'L2_QUEUE_SIZE'
5961
| 'LOG_ELAPSED_TIME'

0 commit comments

Comments
 (0)