-
Notifications
You must be signed in to change notification settings - Fork 579
feat: spartan/bootstrap.sh network_deploy #16639
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: spartan/bootstrap.sh network_deploy #16639
Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. |
476ef9d to
c43de5b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was persistently asking me for sudo when I was running locally.
c43de5b to
fc886cb
Compare
a2635c3 to
ccd7efa
Compare
fc886cb to
b33289f
Compare
ccd7efa to
886fc52
Compare
0e62e56 to
1554f42
Compare
886fc52 to
8a36504
Compare
66a34d9 to
eab9c8a
Compare
eab9c8a to
d28ea7b
Compare
c54ea41 to
af1d837
Compare
| NAMESPACE="v${{ github.event.client_payload.major_version }}-staging-public" | ||
| AZTEC_DOCKER_IMAGE="aztecprotocol/aztec:${{ github.event.client_payload.semver }}" | ||
| ETHEREUM_CHAIN_ID=11155111 | ||
| ETHEREUM_RPC_URLS=${{ secrets.SEPOLIA_RPC_URLS }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These secrets need to be set.
Merge activity
|
bb1295e to
09b9452
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approving since this is something we definitely want, but I'm worried about the complexity of configuration. If I managed to follow the flow correctly, what happens with a config value is:
- Gets defined in an
environments/scenario.envfile - Gets loaded into
scripts/deploy-network.sh(which has its set of defaults) - Gets written into a tfvars file for terraform to pick up
- Gets picked up by terraform from a
variables.tffile (which has its set of defaults) - Gets passed onto
custom_settingsfor a helm release resource in a tf definition - Gets loaded into helm based on a
values.yamlfile (which has its set of defaults) - Gets injected as an env var from a template such as
validator.yaml(or_pod-template.yaml?) - Gets loaded by the node (which has its set of defaults)
Also, it seems there are now duplicate configurations for slashing in helm. I added comments to point to them.
|
|
||
| ```bash | ||
| # run one | ||
| ./spartan/bootstrap.sh test_single scenario.local.env spartan/smoke.test.ts |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| ./spartan/bootstrap.sh test_single scenario.local.env spartan/smoke.test.ts | |
| ./spartan/bootstrap.sh single_test scenario.local.env spartan/smoke.test.ts |
| return committee !== undefined; | ||
| }, | ||
| 'committee', | ||
| 60 * 60, // wait up to 1 hour, since if the rollup was just deployed there will be no committee for 2 epochs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should parameterize timeouts based on the rollup settings
| }, | ||
| { | ||
| gasLimit: 45_000_000n, | ||
| gasLimit: 32_000_000n, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why this change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah! Because I didn't realize the block gas limit was raised to 45M!
spartan/aztec-node/values.yaml
Outdated
| slash: | ||
| minPenaltyPercentage: 0.5 | ||
| maxPenaltyPercentage: 2.0 | ||
| inactivityTargetPercentage: 0.7 | ||
| inactivityPenalty: 0.0 | ||
| prunePenalty: 0.0 | ||
| dataWithholdingPenalty: 0.0 | ||
| proposeInvalidAttestationsPenalty: 0.0 | ||
| attestDescendantOfInvalidPenalty: 0.0 | ||
| unknownPenalty: 0.0 | ||
| invalidBlockPenalty: 0.0 | ||
| offenseExpirationRounds: 8 | ||
| maxPayloadSize: 50 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had set all slash to empty values, so we'd use the defaults defined in the node and we don't have multiple defaults floating around. Any reason for bringing them back?
aztec-packages/spartan/aztec-network/values.yaml
Lines 111 to 131 in 395632f
| # All slashing settings are empty so we rely on the defaults set on ts-land | |
| slash: | |
| # Penalty percentages for slashing offenses | |
| minPenaltyPercentage: "" | |
| maxPenaltyPercentage: "" | |
| # Validator allowlists/denylists | |
| validatorsAlways: [] | |
| validatorsNever: [] | |
| # Penalty amounts for different offense types | |
| prunePenalty: "" | |
| dataWithholdingPenalty: "" | |
| inactivityPenalty: "" | |
| inactivityTargetPercentage: "" | |
| invalidBlockPenalty: "" | |
| proposeInvalidAttestationsPenalty: "" | |
| attestDescendantOfInvalidPenalty: "" | |
| unknownPenalty: "" | |
| # Slasher behavior configuration | |
| gracePeriodL2Slots: "" | |
| offenseExpirationRounds: "" | |
| maxPayloadSize: "" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good call. Thanks.
spartan/scripts/deploy_network.sh
Outdated
| AZTEC_SLASHING_QUORUM=${AZTEC_SLASHING_QUORUM:-17} | ||
| AZTEC_SLASHING_ROUND_SIZE=${AZTEC_SLASHING_ROUND_SIZE:-32} | ||
| AZTEC_SLASHING_ROUND_SIZE_IN_EPOCHS=${AZTEC_SLASHING_ROUND_SIZE_IN_EPOCHS:-4} | ||
| AZTEC_SLASHING_LIFETIME_IN_ROUNDS=${AZTEC_SLASHING_LIFETIME_IN_ROUNDS:-4} | ||
| AZTEC_SLASHING_EXECUTION_DELAY_IN_ROUNDS=${AZTEC_SLASHING_EXECUTION_DELAY_IN_ROUNDS:-0} | ||
| AZTEC_SLASHING_VETOER=${AZTEC_SLASHING_VETOER:-0x0000000000000000000000000000000000000000} | ||
| AZTEC_SLASHING_OFFSET_IN_ROUNDS=${AZTEC_SLASHING_OFFSET_IN_ROUNDS:-2} | ||
| AZTEC_SLASH_AMOUNT_SMALL=${AZTEC_SLASH_AMOUNT_SMALL:-10000000000000000000} | ||
| AZTEC_SLASH_AMOUNT_MEDIUM=${AZTEC_SLASH_AMOUNT_MEDIUM:-20000000000000000000} | ||
| AZTEC_SLASH_AMOUNT_LARGE=${AZTEC_SLASH_AMOUNT_LARGE:-50000000000000000000} | ||
| AZTEC_SLASHER_FLAVOR=${AZTEC_SLASHER_FLAVOR:-tally} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same comment as above on duplicate defaults
| cat > "${DEPLOY_ROLLUP_CONTRACTS_DIR}/terraform.tfvars" << EOF | ||
| K8S_CLUSTER_CONTEXT = "${K8S_CLUSTER_CONTEXT}" | ||
| NAMESPACE = "${NAMESPACE}" | ||
| AZTEC_DOCKER_IMAGE = "${AZTEC_DOCKER_IMAGE}" | ||
| L1_RPC_URLS = "${CSV_RPC_URLS}" | ||
| MNEMONIC = "${LABS_INFRA_MNEMONIC}" | ||
| L1_CHAIN_ID = "${ETHEREUM_CHAIN_ID}" | ||
| SALT = "${SALT}" | ||
| VALIDATORS = "${VALIDATOR_ADDRESSES}" | ||
| SPONSORED_FPC = ${SPONSORED_FPC} | ||
| REAL_VERIFIER = ${REAL_VERIFIER} | ||
| AZTEC_SLOT_DURATION = ${AZTEC_SLOT_DURATION} | ||
| AZTEC_EPOCH_DURATION = ${AZTEC_EPOCH_DURATION} | ||
| AZTEC_TARGET_COMMITTEE_SIZE = ${AZTEC_TARGET_COMMITTEE_SIZE} | ||
| AZTEC_PROOF_SUBMISSION_EPOCHS = ${AZTEC_PROOF_SUBMISSION_EPOCHS} | ||
| AZTEC_ACTIVATION_THRESHOLD = ${AZTEC_ACTIVATION_THRESHOLD} | ||
| AZTEC_EJECTION_THRESHOLD = ${AZTEC_EJECTION_THRESHOLD} | ||
| AZTEC_SLASHING_QUORUM = ${AZTEC_SLASHING_QUORUM} | ||
| AZTEC_SLASHING_ROUND_SIZE = ${AZTEC_SLASHING_ROUND_SIZE} | ||
| AZTEC_SLASHING_ROUND_SIZE_IN_EPOCHS = ${AZTEC_SLASHING_ROUND_SIZE_IN_EPOCHS} | ||
| AZTEC_SLASHING_LIFETIME_IN_ROUNDS = ${AZTEC_SLASHING_LIFETIME_IN_ROUNDS} | ||
| AZTEC_SLASHING_EXECUTION_DELAY_IN_ROUNDS = ${AZTEC_SLASHING_EXECUTION_DELAY_IN_ROUNDS} | ||
| AZTEC_SLASHING_VETOER = "${AZTEC_SLASHING_VETOER}" | ||
| AZTEC_SLASHING_OFFSET_IN_ROUNDS = ${AZTEC_SLASHING_OFFSET_IN_ROUNDS} | ||
| AZTEC_SLASH_AMOUNT_SMALL = ${AZTEC_SLASH_AMOUNT_SMALL} | ||
| AZTEC_SLASH_AMOUNT_MEDIUM = ${AZTEC_SLASH_AMOUNT_MEDIUM} | ||
| AZTEC_SLASH_AMOUNT_LARGE = ${AZTEC_SLASH_AMOUNT_LARGE} | ||
| AZTEC_SLASHER_FLAVOR = "${AZTEC_SLASHER_FLAVOR}" | ||
| AZTEC_GOVERNANCE_PROPOSER_QUORUM = ${AZTEC_GOVERNANCE_PROPOSER_QUORUM} | ||
| AZTEC_GOVERNANCE_PROPOSER_ROUND_SIZE = ${AZTEC_GOVERNANCE_PROPOSER_ROUND_SIZE} | ||
| AZTEC_MANA_TARGET = ${AZTEC_MANA_TARGET} | ||
| AZTEC_PROVING_COST_PER_MANA = ${AZTEC_PROVING_COST_PER_MANA} | ||
| JOB_NAME = "deploy-rollup-contracts" | ||
| JOB_BACKOFF_LIMIT = 3 | ||
| JOB_TTL_SECONDS_AFTER_FINISHED = 3600 | ||
| EOF |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we instead dump all aztec-related env vars here? We should be able to source the list of all vars from env-vars.ts.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm. I think we could. I guess there are a few outside env-vars.ts that we'd want to set.
| DEPLOY_AZTEC_INFRA_DIR="${SCRIPT_DIR}/../terraform/deploy-aztec-infra" | ||
| "${SCRIPT_DIR}/override_terraform_backend.sh" "${DEPLOY_AZTEC_INFRA_DIR}" "${CLUSTER}" "${BASE_STATE_PATH}/deploy-aztec-infra/${SALT}" | ||
|
|
||
| cat > "${DEPLOY_AZTEC_INFRA_DIR}/terraform.tfvars" << EOF |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same comment as above on dumping env vars
| variable "SLASH_MIN_PENALTY_PERCENTAGE" { | ||
| description = "The slash min penalty percentage" | ||
| type = string | ||
| default = 0.5 | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same comment as above on not duplicating default values
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a great call. I'll remove all the defaults from terraform. No need to add layers here.
| - name: SENTINEL_ENABLED | ||
| value: "{{ .Values.node.sentinel.enabled }}" | ||
| - name: SLASH_MIN_PENALTY_PERCENTAGE | ||
| value: "{{ .Values.node.slash.minPenaltyPercentage }}" | ||
| - name: SLASH_MAX_PENALTY_PERCENTAGE | ||
| value: "{{ .Values.node.slash.maxPenaltyPercentage }}" | ||
| - name: SLASH_INACTIVITY_TARGET_PERCENTAGE | ||
| value: "{{ .Values.node.slash.inactivityTargetPercentage }}" | ||
| - name: SLASH_INACTIVITY_PENALTY | ||
| value: "{{ .Values.node.slash.inactivityPenalty }}" | ||
| - name: SLASH_PRUNE_PENALTY | ||
| value: "{{ .Values.node.slash.prunePenalty }}" | ||
| - name: SLASH_DATA_WITHHOLDING_PENALTY | ||
| value: "{{ .Values.node.slash.dataWithholdingPenalty }}" | ||
| - name: SLASH_PROPOSE_INVALID_ATTESTATIONS_PENALTY | ||
| value: "{{ .Values.node.slash.proposeInvalidAttestationsPenalty }}" | ||
| - name: SLASH_ATTEST_DESCENDANT_OF_INVALID_PENALTY | ||
| value: "{{ .Values.node.slash.attestDescendantOfInvalidPenalty }}" | ||
| - name: SLASH_UNKNOWN_PENALTY | ||
| value: "{{ .Values.node.slash.unknownPenalty }}" | ||
| - name: SLASH_INVALID_BLOCK_PENALTY | ||
| value: "{{ .Values.node.slash.invalidBlockPenalty }}" | ||
| - name: SLASH_OFFENSE_EXPIRATION_ROUNDS | ||
| value: "{{ .Values.node.slash.offenseExpirationRounds }}" | ||
| - name: SLASH_MAX_PAYLOAD_SIZE | ||
| value: "{{ .Values.node.slash.maxPayloadSize }}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had injected these in the validator.yaml template, should we remove them from either of the two?
aztec-packages/spartan/aztec-network/templates/validator.yaml
Lines 194 to 253 in 395632f
| {{- if .Values.aztec.slash.minPenaltyPercentage }} | |
| - name: SLASH_MIN_PENALTY_PERCENTAGE | |
| value: {{ .Values.aztec.slash.minPenaltyPercentage | quote }} | |
| {{- end }} | |
| {{- if .Values.aztec.slash.maxPenaltyPercentage }} | |
| - name: SLASH_MAX_PENALTY_PERCENTAGE | |
| value: {{ .Values.aztec.slash.maxPenaltyPercentage | quote }} | |
| {{- end }} | |
| {{- if .Values.aztec.slash.validatorsAlways }} | |
| - name: SLASH_VALIDATORS_ALWAYS | |
| value: {{ join "," .Values.aztec.slash.validatorsAlways | quote }} | |
| {{- end }} | |
| {{- if .Values.aztec.slash.validatorsNever }} | |
| - name: SLASH_VALIDATORS_NEVER | |
| value: {{ join "," .Values.aztec.slash.validatorsNever | quote }} | |
| {{- end }} | |
| {{- if .Values.aztec.slash.prunePenalty }} | |
| - name: SLASH_PRUNE_PENALTY | |
| value: {{ .Values.aztec.slash.prunePenalty | quote }} | |
| {{- end }} | |
| {{- if .Values.aztec.slash.dataWithholdingPenalty }} | |
| - name: SLASH_DATA_WITHHOLDING_PENALTY | |
| value: {{ .Values.aztec.slash.dataWithholdingPenalty | quote }} | |
| {{- end }} | |
| {{- if .Values.aztec.slash.inactivityPenalty }} | |
| - name: SLASH_INACTIVITY_PENALTY | |
| value: {{ .Values.aztec.slash.inactivityPenalty | quote }} | |
| {{- end }} | |
| {{- if .Values.aztec.slash.inactivityTargetPercentage }} | |
| - name: SLASH_INACTIVITY_TARGET_PERCENTAGE | |
| value: {{ .Values.aztec.slash.inactivityTargetPercentage | quote }} | |
| {{- end }} | |
| {{- if .Values.aztec.slash.invalidBlockPenalty }} | |
| - name: SLASH_INVALID_BLOCK_PENALTY | |
| value: {{ .Values.aztec.slash.invalidBlockPenalty | quote }} | |
| {{- end }} | |
| {{- if .Values.aztec.slash.proposeInvalidAttestationsPenalty }} | |
| - name: SLASH_PROPOSE_INVALID_ATTESTATIONS_PENALTY | |
| value: {{ .Values.aztec.slash.proposeInvalidAttestationsPenalty | quote }} | |
| {{- end }} | |
| {{- if .Values.aztec.slash.attestDescendantOfInvalidPenalty }} | |
| - name: SLASH_ATTEST_DESCENDANT_OF_INVALID_PENALTY | |
| value: {{ .Values.aztec.slash.attestDescendantOfInvalidPenalty | quote }} | |
| {{- end }} | |
| {{- if .Values.aztec.slash.unknownPenalty }} | |
| - name: SLASH_UNKNOWN_PENALTY | |
| value: {{ .Values.aztec.slash.unknownPenalty | quote }} | |
| {{- end }} | |
| {{- if .Values.aztec.slash.gracePeriodL2Slots }} | |
| - name: SLASH_GRACE_PERIOD_L2_SLOTS | |
| value: {{ .Values.aztec.slash.gracePeriodL2Slots | quote }} | |
| {{- end }} | |
| {{- if .Values.aztec.slash.offenseExpirationRounds }} | |
| - name: SLASH_OFFENSE_EXPIRATION_ROUNDS | |
| value: {{ .Values.aztec.slash.offenseExpirationRounds | quote }} | |
| {{- end }} | |
| {{- if .Values.aztec.slash.maxPayloadSize }} | |
| - name: SLASH_MAX_PAYLOAD_SIZE | |
| value: {{ .Values.aztec.slash.maxPayloadSize | quote }} | |
| {{- end }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah nice. I've used what you have. Very soon I think we will remove the aztec-network chart.
09b9452 to
3714c57
Compare
You're absolutely right in the current flow, and its unnecessary complexity. I removed the defaults out of deploy-network.sh, and the variables.tf, and the helm values yaml. Now if nothing is set, it just uses the default values in TS. The flow you've described is still correct, but removing all the defaults makes it much easier to reason about. |
3714c57 to
0232f6a
Compare
0232f6a to
e0433ce
Compare
e0433ce to
97d52ef
Compare

Drop the effort to run local workflows via
act and instead adopt the existing pattern of:You can now, e.g.: