Skip to content

Commit b3628eb

Browse files
committed
kind upgrade test
1 parent a5c2f2b commit b3628eb

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+1591
-389
lines changed

l1-contracts/src/core/Rollup.sol

-4
Original file line numberDiff line numberDiff line change
@@ -505,10 +505,6 @@ contract Rollup is IStaking, IValidatorSelection, IRollup, RollupCore {
505505
return STFLib.getStorage().provingCostPerMana;
506506
}
507507

508-
function getSlashFactory() external view override(IRollup) returns (address) {
509-
return rollupStore.slashFactory;
510-
}
511-
512508
function getProvingCostPerManaInFeeAsset()
513509
external
514510
view

l1-contracts/src/core/RollupCore.sol

-4
Original file line numberDiff line numberDiff line change
@@ -190,10 +190,6 @@ contract RollupCore is
190190
return accumulatedRewards;
191191
}
192192

193-
function setSlashFactory(address _slashFactory) external override(IRollupCore) onlyOwner {
194-
rollupStore.slashFactory = _slashFactory;
195-
}
196-
197193
function deposit(address _attester, address _proposer, address _withdrawer, uint256 _amount)
198194
external
199195
override(IStakingCore)

l1-contracts/src/core/interfaces/IRollup.sol

-3
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,6 @@ struct RollupConfig {
7777
// TODO(#8955): When implementing batched kzg proofs, store one instance per epoch rather than block
7878
struct RollupStore {
7979
ChainTips tips; // put first such that the struct slot structure is easy to follow for cheatcodes
80-
address slashFactory;
8180
mapping(uint256 blockNumber => BlockLog log) blocks;
8281
mapping(uint256 blockNumber => bytes32) blobPublicInputsHashes;
8382
L1GasOracleValues l1GasOracleValues;
@@ -125,8 +124,6 @@ interface IRollupCore {
125124

126125
function setProvingCostPerMana(EthValue _provingCostPerMana) external;
127126

128-
function setSlashFactory(address _slashFactory) external;
129-
130127
function propose(
131128
ProposeArgs calldata _args,
132129
Signature[] memory _signatures,

l1-contracts/src/governance/Governance.sol

+5-5
Original file line numberDiff line numberDiff line change
@@ -48,13 +48,13 @@ contract Governance is IGovernance {
4848

4949
configuration = DataStructures.Configuration({
5050
proposeConfig: DataStructures.ProposeConfiguration({
51-
lockDelay: Timestamp.wrap(3600),
51+
lockDelay: Timestamp.wrap(60),
5252
lockAmount: 1000e18
5353
}),
54-
votingDelay: Timestamp.wrap(3600),
55-
votingDuration: Timestamp.wrap(3600),
56-
executionDelay: Timestamp.wrap(3600),
57-
gracePeriod: Timestamp.wrap(3600),
54+
votingDelay: Timestamp.wrap(60),
55+
votingDuration: Timestamp.wrap(60),
56+
executionDelay: Timestamp.wrap(60),
57+
gracePeriod: Timestamp.wrap(60),
5858
quorum: 0.1e18,
5959
voteDifferential: 0.04e18,
6060
minimumVotes: 1000e18

l1-contracts/src/governance/libraries/ConfigurationLib.sol

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ library ConfigurationLib {
1616

1717
uint256 internal constant VOTES_LOWER = 1;
1818

19-
Timestamp internal constant TIME_LOWER = Timestamp.wrap(3600);
19+
Timestamp internal constant TIME_LOWER = Timestamp.wrap(60);
2020
Timestamp internal constant TIME_UPPER = Timestamp.wrap(30 * 24 * 3600);
2121

2222
function withdrawalDelay(DataStructures.Configuration storage _self)

l1-contracts/src/governance/libraries/DataStructures.sol

+1
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ library DataStructures {
4444
uint256 nea;
4545
}
4646

47+
// @notice if this changes, please update the enum in governance.ts
4748
enum ProposalState {
4849
Pending,
4950
Active,

spartan/aztec-network/files/config/config-prover-env.sh

+5-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,11 @@ output=$(node --no-warnings /usr/src/yarn-project/aztec/dest/bin/index.js get-no
77

88
echo "$output"
99

10-
boot_node_enr=$(echo "$output" | grep -oP 'Node ENR: \Kenr:[a-zA-Z0-9\-\_\.]+')
10+
boot_node_enr=""
11+
if [ "$P2P_ENABLED" = "true" ]; then
12+
# Only look for boot node ENR if P2P is enabled
13+
boot_node_enr=$(echo "$output" | grep -oP 'Node ENR: \Kenr:[a-zA-Z0-9\-\_\.]+')
14+
fi
1115
rollup_address=$(echo "$output" | grep -oP 'Rollup Address: \K0x[a-fA-F0-9]{40}')
1216
registry_address=$(echo "$output" | grep -oP 'Registry Address: \K0x[a-fA-F0-9]{40}')
1317
inbox_address=$(echo "$output" | grep -oP 'L1 -> L2 Inbox Address: \K0x[a-fA-F0-9]{40}')

spartan/aztec-network/files/config/config-validator-env.sh

+5-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,11 @@ output=$(node --no-warnings /usr/src/yarn-project/aztec/dest/bin/index.js get-no
77

88
echo "$output"
99

10-
boot_node_enr=$(echo "$output" | grep -oP 'Node ENR: \Kenr:[a-zA-Z0-9\-\_\.]+')
10+
boot_node_enr=""
11+
if [ "$P2P_ENABLED" = "true" ]; then
12+
# Only look for boot node ENR if P2P is enabled
13+
boot_node_enr=$(echo "$output" | grep -oP 'Node ENR: \Kenr:[a-zA-Z0-9\-\_\.]+')
14+
fi
1115
rollup_address=$(echo "$output" | grep -oP 'Rollup Address: \K0x[a-fA-F0-9]{40}')
1216
registry_address=$(echo "$output" | grep -oP 'Registry Address: \K0x[a-fA-F0-9]{40}')
1317
inbox_address=$(echo "$output" | grep -oP 'L1 -> L2 Inbox Address: \K0x[a-fA-F0-9]{40}')

spartan/aztec-network/files/config/deploy-l1-contracts.sh

+17-21
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,17 @@
11
#!/bin/bash
22
set -exu
33

4+
# If REGISTRY_CONTRACT_ADDRESS is already set, skip deployment and just write the file
5+
if [ -n "${REGISTRY_CONTRACT_ADDRESS:-}" ]; then
6+
echo "Registry address already set. Skipping deployment."
7+
# Write the addresses to a file in the shared volume
8+
cat <<EOF >/shared/contracts/contracts.env
9+
export REGISTRY_CONTRACT_ADDRESS=$REGISTRY_CONTRACT_ADDRESS
10+
EOF
11+
cat /shared/contracts/contracts.env
12+
exit 0
13+
fi
14+
415
SALT=${1:-$RANDOM}
516
CHAIN_ID=$2
617
VALIDATOR_ADDRESSES=$3
@@ -9,10 +20,15 @@ VALIDATOR_ADDRESSES=$3
920
output=""
1021
MAX_RETRIES=5
1122
RETRY_DELAY=15
23+
TEST_ACCOUNTS=${TEST_ACCOUNTS:-false}
24+
TEST_ACCOUNTS_ARG=""
25+
if [ "$TEST_ACCOUNTS" = "true" ]; then
26+
TEST_ACCOUNTS_ARG="--test-accounts"
27+
fi
1228

1329
for attempt in $(seq 1 $MAX_RETRIES); do
1430
# Construct base command
15-
base_cmd="LOG_LEVEL=debug node --no-warnings /usr/src/yarn-project/aztec/dest/bin/index.js deploy-l1-contracts --test-accounts"
31+
base_cmd="LOG_LEVEL=debug node --no-warnings /usr/src/yarn-project/aztec/dest/bin/index.js deploy-l1-contracts $TEST_ACCOUNTS_ARG"
1632

1733
# Add account - use private key if set, otherwise use mnemonic
1834
if [ -n "${L1_DEPLOYMENT_PRIVATE_KEY:-}" ]; then
@@ -38,32 +54,12 @@ done || {
3854
echo "$output"
3955

4056
# Extract contract addresses using grep and regex
41-
rollup_address=$(echo "$output" | grep -oP 'Rollup Address: \K0x[a-fA-F0-9]{40}')
4257
registry_address=$(echo "$output" | grep -oP 'Registry Address: \K0x[a-fA-F0-9]{40}')
43-
inbox_address=$(echo "$output" | grep -oP 'L1 -> L2 Inbox Address: \K0x[a-fA-F0-9]{40}')
44-
outbox_address=$(echo "$output" | grep -oP 'L2 -> L1 Outbox Address: \K0x[a-fA-F0-9]{40}')
45-
fee_juice_address=$(echo "$output" | grep -oP 'Fee Juice Address: \K0x[a-fA-F0-9]{40}')
46-
staking_asset_address=$(echo "$output" | grep -oP 'Staking Asset Address: \K0x[a-fA-F0-9]{40}')
47-
fee_juice_portal_address=$(echo "$output" | grep -oP 'Fee Juice Portal Address: \K0x[a-fA-F0-9]{40}')
48-
coin_issuer_address=$(echo "$output" | grep -oP 'CoinIssuer Address: \K0x[a-fA-F0-9]{40}')
49-
reward_distributor_address=$(echo "$output" | grep -oP 'RewardDistributor Address: \K0x[a-fA-F0-9]{40}')
50-
governance_proposer_address=$(echo "$output" | grep -oP 'GovernanceProposer Address: \K0x[a-fA-F0-9]{40}')
51-
governance_address=$(echo "$output" | grep -oP 'Governance Address: \K0x[a-fA-F0-9]{40}')
5258
slash_factory_address=$(echo "$output" | grep -oP 'SlashFactory Address: \K0x[a-fA-F0-9]{40}')
5359

5460
# Write the addresses to a file in the shared volume
5561
cat <<EOF >/shared/contracts/contracts.env
56-
export ROLLUP_CONTRACT_ADDRESS=$rollup_address
5762
export REGISTRY_CONTRACT_ADDRESS=$registry_address
58-
export INBOX_CONTRACT_ADDRESS=$inbox_address
59-
export OUTBOX_CONTRACT_ADDRESS=$outbox_address
60-
export FEE_JUICE_CONTRACT_ADDRESS=$fee_juice_address
61-
export STAKING_ASSET_CONTRACT_ADDRESS=$staking_asset_address
62-
export FEE_JUICE_PORTAL_CONTRACT_ADDRESS=$fee_juice_portal_address
63-
export COIN_ISSUER_CONTRACT_ADDRESS=$coin_issuer_address
64-
export REWARD_DISTRIBUTOR_CONTRACT_ADDRESS=$reward_distributor_address
65-
export GOVERNANCE_PROPOSER_CONTRACT_ADDRESS=$governance_proposer_address
66-
export GOVERNANCE_CONTRACT_ADDRESS=$governance_address
6763
export SLASH_FACTORY_CONTRACT_ADDRESS=$slash_factory_address
6864
EOF
6965

spartan/aztec-network/templates/boot-node.yaml

+6-32
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,6 @@ spec:
7676
volumeMounts:
7777
- name: config
7878
mountPath: /shared/config
79-
{{- if .Values.bootNode.deployContracts }}
8079
- name: deploy-l1-contracts
8180
{{- include "aztec-network.image" . | nindent 10 }}
8281
command:
@@ -99,6 +98,10 @@ spec:
9998
- name: scripts
10099
mountPath: /scripts
101100
env:
101+
- name: TEST_ACCOUNTS
102+
value: "{{ .Values.aztec.testAccounts }}"
103+
- name: REGISTRY_CONTRACT_ADDRESS
104+
value: "{{ .Values.bootNode.contracts.registryAddress }}"
102105
- name: TELEMETRY
103106
value: "{{ .Values.telemetry.enabled }}"
104107
- name: INIT_VALIDATORS
@@ -133,7 +136,6 @@ spec:
133136
fieldPath: metadata.namespace
134137
- name: USE_GCLOUD_LOGGING
135138
value: "{{ .Values.telemetry.useGcloudLogging }}"
136-
{{- end }}
137139
containers:
138140
- name: boot-node
139141
{{- include "aztec-network.image" . | nindent 10 }}
@@ -168,14 +170,8 @@ spec:
168170
mountPath: /shared/config
169171
- name: boot-node-data
170172
mountPath: {{ .Values.bootNode.dataDir }}
171-
{{- if .Values.bootNode.deployContracts }}
172173
- name: scripts-output
173174
mountPath: /shared/contracts
174-
{{- else }}
175-
- name: contracts-env
176-
mountPath: /shared/contracts/contracts.env
177-
subPath: contracts.env
178-
{{- end }}
179175
env:
180176
- name: POD_IP
181177
valueFrom:
@@ -253,6 +249,8 @@ spec:
253249
value: "{{ .Values.telemetry.useGcloudLogging }}"
254250
- name: OTEL_EXCLUDE_METRICS
255251
value: "{{ .Values.telemetry.excludeMetrics }}"
252+
- name: TEST_ACCOUNTS
253+
value: "{{ .Values.aztec.testAccounts }}"
256254
{{- if .Values.blobSink.enabled }}
257255
- name: BLOB_SINK_URL
258256
value: {{ include "aztec-network.blobSinkUrl" . }}
@@ -277,35 +275,11 @@ spec:
277275
persistentVolumeClaim:
278276
claimName: boot-node-data
279277
{{- end }}
280-
{{- if .Values.bootNode.deployContracts }}
281278
- name: scripts
282279
configMap:
283280
name: {{ include "aztec-network.fullname" . }}-scripts
284281
- name: scripts-output
285282
emptyDir: {}
286-
{{- else }}
287-
- name: contracts-env
288-
configMap:
289-
name: {{ include "aztec-network.fullname" . }}-contracts-env
290-
{{- end }}
291-
{{- if not .Values.bootNode.deployContracts }}
292-
---
293-
apiVersion: v1
294-
kind: ConfigMap
295-
metadata:
296-
name: {{ include "aztec-network.fullname" . }}-contracts-env
297-
labels:
298-
{{- include "aztec-network.labels" . | nindent 4 }}
299-
data:
300-
contracts.env: |
301-
export ROLLUP_CONTRACT_ADDRESS={{ .Values.bootNode.contracts.rollupAddress }}
302-
export REGISTRY_CONTRACT_ADDRESS={{ .Values.bootNode.contracts.registryAddress }}
303-
export INBOX_CONTRACT_ADDRESS={{ .Values.bootNode.contracts.inboxAddress }}
304-
export OUTBOX_CONTRACT_ADDRESS={{ .Values.bootNode.contracts.outboxAddress }}
305-
export FEE_JUICE_CONTRACT_ADDRESS={{ .Values.bootNode.contracts.feeJuiceAddress }}
306-
export STAKING_ASSET_CONTRACT_ADDRESS={{ .Values.bootNode.contracts.stakingAssetAddress }}
307-
export FEE_JUICE_PORTAL_CONTRACT_ADDRESS={{ .Values.bootNode.contracts.feeJuicePortalAddress }}
308-
{{- end }}
309283
---
310284
# Headless service for StatefulSet DNS entries
311285
apiVersion: v1

spartan/aztec-network/templates/prover-node.yaml

+5
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,9 @@ spec:
113113
mountPath: /scripts
114114
- name: config
115115
mountPath: /shared/config
116+
env:
117+
- name: P2P_ENABLED
118+
value: "{{ .Values.proverNode.p2p.enabled }}"
116119

117120
containers:
118121
- name: prover-node
@@ -225,6 +228,8 @@ spec:
225228
value: "{{ .Values.telemetry.useGcloudLogging }}"
226229
- name: OTEL_EXCLUDE_METRICS
227230
value: "{{ .Values.telemetry.excludeMetrics }}"
231+
- name: TEST_ACCOUNTS
232+
value: "{{ .Values.aztec.testAccounts }}"
228233
{{- if .Values.blobSink.enabled }}
229234
- name: BLOB_SINK_URL
230235
value: {{ include "aztec-network.blobSinkUrl" . }}

spartan/aztec-network/templates/pxe.yaml

+2
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,8 @@ spec:
117117
value: "{{ .Values.telemetry.excludeMetrics }}"
118118
- name: L1_CHAIN_ID
119119
value: "{{ .Values.ethereum.chainId }}"
120+
- name: TEST_ACCOUNTS
121+
value: "{{ .Values.aztec.testAccounts }}"
120122
ports:
121123
- name: http
122124
containerPort: {{ .Values.pxe.service.nodePort }}

spartan/aztec-network/templates/setup-l2-contracts.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ spec:
6565
done
6666
echo "PXE service is ready!"
6767
set -e
68-
node --no-warnings /usr/src/yarn-project/aztec/dest/bin/index.js setup-protocol-contracts --skipProofWait
68+
LOG_LEVEL=debug node --no-warnings /usr/src/yarn-project/aztec/dest/bin/index.js setup-protocol-contracts --skipProofWait
6969
echo "L2 contracts initialized"
7070
env:
7171
- name: K8S_POD_UID

spartan/aztec-network/templates/transaction-bot.yaml

+2
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,8 @@ spec:
164164
value: "{{ .Values.telemetry.excludeMetrics }}"
165165
- name: L1_CHAIN_ID
166166
value: "{{ .Values.ethereum.chainId }}"
167+
- name: TEST_ACCOUNTS
168+
value: "{{ .Values.aztec.testAccounts }}"
167169
ports:
168170
- name: http
169171
containerPort: {{ .Values.bot.service.nodePort }}

spartan/aztec-network/templates/validator.yaml

+5
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,9 @@ spec:
117117
mountPath: /scripts
118118
- name: config
119119
mountPath: /shared/config
120+
env:
121+
- name: P2P_ENABLED
122+
value: "{{ .Values.validator.p2p.enabled }}"
120123
containers:
121124
- name: validator
122125
{{- include "aztec-network.image" . | nindent 10 }}
@@ -237,6 +240,8 @@ spec:
237240
value: "{{ .Values.telemetry.useGcloudLogging }}"
238241
- name: OTEL_EXCLUDE_METRICS
239242
value: "{{ .Values.telemetry.excludeMetrics }}"
243+
- name: TEST_ACCOUNTS
244+
value: "{{ .Values.aztec.testAccounts }}"
240245
{{- if .Values.blobSink.enabled }}
241246
- name: BLOB_SINK_URL
242247
value: {{ include "aztec-network.blobSinkUrl" . }}

spartan/aztec-network/values.yaml

+2-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,8 @@ aztec:
5959
extraAccounts: 10
6060

6161
botKeyIndexStart: 3000
62-
l1Salt: "" # leave empty for random salt
62+
l1Salt: "42" # leave empty for random salt
63+
testAccounts: true
6364

6465
bootNode:
6566
peerIdPrivateKey: ""

spartan/aztec-network/values/1-validators.yaml

+2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ telemetry:
33

44
validator:
55
replicas: 1
6+
sequencer:
7+
minTxsPerBlock: 0
68
validator:
79
disabled: false
810

spartan/bootstrap.sh

+5
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ function test_cmds {
6161
echo "$hash timeout -v 20m ./spartan/bootstrap.sh test-kind-transfer"
6262
echo "$hash timeout -v 30m ./spartan/bootstrap.sh test-kind-4epochs"
6363
echo "$hash timeout -v 30m ./spartan/bootstrap.sh test-kind-transfer-blob-with-sink"
64+
echo "$hash timeout -v 30m ./spartan/bootstrap.sh test-kind-upgrade-rollup-version"
6465
fi
6566
}
6667

@@ -129,6 +130,10 @@ case "$cmd" in
129130
# export OVERRIDES="blobSink.enabled=true"
130131
./bootstrap.sh test-kind-transfer
131132
;;
133+
"test-kind-upgrade-rollup-version")
134+
export OVERRIDES="bot.enabled=false"
135+
NAMESPACE=upgrade-rollup-version FRESH_INSTALL=${FRESH_INSTALL:-true} INSTALL_METRICS=false ./scripts/test_kind.sh src/spartan/upgrade_rollup_version.test.ts ci.yaml
136+
;;
132137
"test-local")
133138
# Isolate network stack in docker.
134139
docker_isolate ../scripts/run_native_testnet.sh -i -val 3

spartan/scripts/deploy_kind.sh

+8-4
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@
99
# AZTEC_DOCKER_TAG (default: current git commit)
1010
# INSTALL_TIMEOUT (default: 30m)
1111
# OVERRIDES (default: "", no overrides)
12+
#
13+
# Note on OVERRIDES:
14+
# You can use like OVERRIDES="replicas=3,resources.limits.cpu=1"
1215

1316
source $(git rev-parse --show-toplevel)/ci3/source
1417

@@ -18,6 +21,7 @@ set -x
1821
namespace="$1"
1922
values_file="${2:-default.yaml}"
2023
sepolia_deployment="${3:-false}"
24+
helm_instance="${4:-spartan}"
2125

2226
# Default values for environment variables
2327
chaos_values="${CHAOS_VALUES:-}"
@@ -83,9 +87,9 @@ fi
8387

8488
# Install the Helm chart
8589
echo "Cleaning up any existing Helm releases..."
86-
helm uninstall spartan -n "$namespace" 2>/dev/null || true
87-
kubectl delete clusterrole spartan-aztec-network-node 2>/dev/null || true
88-
kubectl delete clusterrolebinding spartan-aztec-network-node 2>/dev/null || true
90+
helm uninstall "$helm_instance" -n "$namespace" 2>/dev/null || true
91+
kubectl delete clusterrole "$helm_instance"-aztec-network-node 2>/dev/null || true
92+
kubectl delete clusterrolebinding "$helm_instance"-aztec-network-node 2>/dev/null || true
8993

9094
helm_set_args=(
9195
--set images.aztec.image="aztecprotocol/aztec:$aztec_docker_tag"
@@ -109,7 +113,7 @@ if [ "$sepolia_deployment" = "true" ]; then
109113
fi
110114
fi
111115

112-
helm upgrade --install spartan ../aztec-network \
116+
helm upgrade --install "$helm_instance" ../aztec-network \
113117
--namespace "$namespace" \
114118
--create-namespace \
115119
"${helm_set_args[@]}" \

0 commit comments

Comments
 (0)