Skip to content

Commit

Permalink
chore: hot fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
just-mitch committed Dec 17, 2024
1 parent f540fbe commit 4e00dc4
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 19 deletions.
10 changes: 0 additions & 10 deletions .github/workflows/publish-aztec-packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -324,16 +324,6 @@ jobs:
--VERSION=${{ steps.version_step.outputs.VERSION }} \
--DRY_RUN=${{ (github.event.inputs.publish == 'false') && '1' || '0' }}
- name: Publish spartan NPM package
run: |
earthly-ci \
--no-output \
--secret NPM_TOKEN=${{ env.NPM_TOKEN }} \
./spartan/releases/rough-rhino+publish-npm \
--DIST_TAG=${{ steps.version_step.outputs.DIST_TAG }} \
--VERSION=${{ steps.version_step.outputs.VERSION }} \
--DRY_RUN=${{ (github.event.inputs.publish == 'false') && '1' || '0' }}
publish-aztec-up:
needs: [configure, publish-manifests]
runs-on: ubuntu-latest
Expand Down
8 changes: 7 additions & 1 deletion spartan/aztec-network/templates/boot-node.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,13 @@ spec:
- -c
- |
source /shared/config/service-addresses
cast publish --rpc-url ${ETHEREUM_HOST} 0xf8a58085174876e800830186a08080b853604580600e600039806000f350fe7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe03601600081602082378035828234f58015156039578182fd5b8082525050506014600cf31ba02222222222222222222222222222222222222222222222222222222222222222a02222222222222222222222222222222222222222222222222222222222222222
output=$(cast code 0x4e59b44847b379578588920cA78FbF26c0B4956C --rpc-url ${ETHEREUM_HOST})
if [ "$output" == "0x" ]; then
echo "Deploying create2 deployer"
cast publish --rpc-url ${ETHEREUM_HOST} 0xf8a58085174876e800830186a08080b853604580600e600039806000f350fe7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe03601600081602082378035828234f58015156039578182fd5b8082525050506014600cf31ba02222222222222222222222222222222222222222222222222222222222222222a02222222222222222222222222222222222222222222222222222222222222222
else
echo "Create2 deployer already deployed"
fi
volumeMounts:
- name: config
mountPath: /shared/config
Expand Down
8 changes: 5 additions & 3 deletions spartan/aztec-network/templates/reth.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,6 @@ spec:
name: {{ include "aztec-network.fullname" . }}-reth-genesis
- name: genesis-output
emptyDir: {}
{{if not .Values.network.public }}
---
apiVersion: v1
kind: Service
Expand All @@ -108,7 +107,11 @@ metadata:
labels:
{{- include "aztec-network.labels" . | nindent 4 }}
spec:
type: {{ .Values.ethereum.service.type }}
{{- if .Values.network.public }}
type: LoadBalancer
{{- else }}
type: ClusterIP
{{- end }}
selector:
{{- include "aztec-network.selectorLabels" . | nindent 4 }}
app: ethereum
Expand All @@ -119,7 +122,6 @@ spec:
{{- if and (eq .Values.ethereum.service.type "NodePort") .Values.ethereum.service.nodePort }}
nodePort: {{ .Values.ethereum.service.nodePort }}
{{- end }}
{{ end }}
---
apiVersion: v1
kind: ConfigMap
Expand Down
1 change: 0 additions & 1 deletion spartan/aztec-network/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,6 @@ ethereum:
gasLimit: "1000000000"
args: ""
service:
type: ClusterIP
port: 8545
targetPort: 8545
nodePort: ""
Expand Down
6 changes: 6 additions & 0 deletions spartan/aztec-network/values/rc-1.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
network:
public: true

ethereum:
resources:
requests:
memory: "31Gi"
cpu: "200m"

aztec:
slotDuration: 36
epochDuration: 48
Expand Down
21 changes: 17 additions & 4 deletions yarn-project/ethereum/src/deploy_l1_contracts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -432,26 +432,38 @@ export const deployL1Contracts = async (
txHashes.push(txHash);
}

if (args.initialValidators && args.initialValidators.length > 0) {
const attesters = (await rollup.read
.getAttesters([])
.then(attesters =>
(attesters as `0x${string}`[]).map(attester => EthAddress.fromString(attester.toString())),
)) as EthAddress[];

logger.debug(`Existing attesters`, attesters);

const newAttesters = (args.initialValidators ?? []).filter(v => !attesters.some(a => a.equals(v)));

if (newAttesters.length > 0) {
// Mint tokens, approve them, use cheat code to initialise validator set without setting up the epoch.
const stakeNeeded = MINIMUM_STAKE * BigInt(args.initialValidators.length);
const stakeNeeded = MINIMUM_STAKE * BigInt(newAttesters.length);
await Promise.all(
[
await stakingAsset.write.mint([walletClient.account.address, stakeNeeded], {} as any),
await stakingAsset.write.approve([rollupAddress.toString(), stakeNeeded], {} as any),
].map(txHash => publicClient.waitForTransactionReceipt({ hash: txHash })),
);

logger.info(`Minted ${newAttesters.length} validators`);

const initiateValidatorSetTxHash = await rollup.write.cheat__InitialiseValidatorSet([
args.initialValidators.map(v => ({
newAttesters.map(v => ({
attester: v.toString(),
proposer: v.toString(),
withdrawer: v.toString(),
amount: MINIMUM_STAKE,
})),
]);
txHashes.push(initiateValidatorSetTxHash);
logger.info(`Initialized validator set (${args.initialValidators.join(', ')}) in tx ${initiateValidatorSetTxHash}`);
logger.info(`Initialized validator set (${newAttesters.join(', ')}) in tx ${initiateValidatorSetTxHash}`);
}

// @note This value MUST match what is in `constants.nr`. It is currently specified here instead of just importing
Expand Down Expand Up @@ -521,6 +533,7 @@ export const deployL1Contracts = async (
client: walletClient,
});
if (!(await registryContract.read.isRollupRegistered([getAddress(rollupAddress.toString())]))) {
logger.info(`Registry ${registryAddress} is not registered to rollup ${rollupAddress}`);
const upgradeTxHash = await registryContract.write.upgrade([getAddress(rollupAddress.toString())], { account });
logger.verbose(
`Upgrading registry contract at ${registryAddress} to rollup ${rollupAddress} in tx ${upgradeTxHash}`,
Expand Down

0 comments on commit 4e00dc4

Please sign in to comment.