Skip to content

Conversation

@just-mitch
Copy link
Collaborator

@just-mitch just-mitch commented Aug 28, 2025

Drop the effort to run local workflows via act​ and instead adopt the existing pattern of:

  1. configure in github action
  2. call bootstrap

You can now, e.g.:

./spartan/bootstrap.sh network_deploy scenario.internal.env
./spartan/bootstrap.sh single_test scenario.local.env spartan/smoke.test.ts
  • Add documentation in DEVELOP.md
  • Fix deployments after changes to json processing
  • nuke a bunch of unused github actions
  • write github action to do scenario network creation/tests and staging-public network creation

Copy link
Collaborator Author

just-mitch commented Aug 28, 2025

@just-mitch just-mitch changed the title mitch/tmnt-225-create-guide-to-run-local-network-tests chore: -create-guide-to-run-local-network-tests Aug 28, 2025
@just-mitch just-mitch changed the title chore: -create-guide-to-run-local-network-tests chore: create guide to run local network tests Aug 28, 2025
@just-mitch just-mitch marked this pull request as ready for review August 28, 2025 17:39
@just-mitch just-mitch requested a review from charlielye as a code owner August 28, 2025 17:39
@just-mitch just-mitch force-pushed the 08-28-mitch_tmnt-225-create-guide-to-run-local-network-tests branch from 476ef9d to c43de5b Compare August 28, 2025 17:54
Copy link
Collaborator Author

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.

@just-mitch just-mitch force-pushed the 08-28-mitch_tmnt-225-create-guide-to-run-local-network-tests branch from c43de5b to fc886cb Compare August 28, 2025 18:40
@just-mitch just-mitch force-pushed the 08-26-mitch_tmnt-168-create-test-network-scenariosyml branch 2 times, most recently from a2635c3 to ccd7efa Compare August 29, 2025 00:54
@just-mitch just-mitch force-pushed the 08-28-mitch_tmnt-225-create-guide-to-run-local-network-tests branch from fc886cb to b33289f Compare August 29, 2025 00:54
@just-mitch just-mitch force-pushed the 08-26-mitch_tmnt-168-create-test-network-scenariosyml branch from ccd7efa to 886fc52 Compare August 29, 2025 01:06
@just-mitch just-mitch force-pushed the 08-28-mitch_tmnt-225-create-guide-to-run-local-network-tests branch 2 times, most recently from 0e62e56 to 1554f42 Compare August 29, 2025 10:31
@just-mitch just-mitch force-pushed the 08-26-mitch_tmnt-168-create-test-network-scenariosyml branch from 886fc52 to 8a36504 Compare August 29, 2025 10:31
Base automatically changed from 08-26-mitch_tmnt-168-create-test-network-scenariosyml to next August 29, 2025 11:34
@just-mitch just-mitch force-pushed the 08-28-mitch_tmnt-225-create-guide-to-run-local-network-tests branch 2 times, most recently from 66a34d9 to eab9c8a Compare August 29, 2025 12:21
@just-mitch just-mitch enabled auto-merge August 29, 2025 12:24
@just-mitch just-mitch force-pushed the 08-28-mitch_tmnt-225-create-guide-to-run-local-network-tests branch from eab9c8a to d28ea7b Compare August 30, 2025 16:39
@just-mitch just-mitch changed the title chore: create guide to run local network tests feat: spartan/bootstrap.sh network_deploy Aug 31, 2025
@just-mitch just-mitch force-pushed the 08-28-mitch_tmnt-225-create-guide-to-run-local-network-tests branch from c54ea41 to af1d837 Compare August 31, 2025 17:18
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 }}
Copy link
Collaborator Author

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.

@graphite-app
Copy link

graphite-app bot commented Sep 1, 2025

Merge activity

  • Sep 1, 11:48 PM UTC: This pull request can not be added to the Graphite merge queue. Please try rebasing and resubmitting to merge when ready.
  • Sep 1, 11:48 PM UTC: Graphite disabled "merge when ready" on this PR due to: a merge conflict with the target branch; resolve the conflict and try again..

@just-mitch just-mitch force-pushed the 08-28-mitch_tmnt-225-create-guide-to-run-local-network-tests branch 2 times, most recently from bb1295e to 09b9452 Compare September 2, 2025 16:33
Copy link
Contributor

@spalladino spalladino left a 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.env file
  • 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.tf file (which has its set of defaults)
  • Gets passed onto custom_settings for a helm release resource in a tf definition
  • Gets loaded into helm based on a values.yaml file (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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
./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
Copy link
Contributor

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,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why this change?

Copy link
Collaborator Author

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!

Comment on lines 121 to 133
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
Copy link
Contributor

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?

# 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: ""

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good call. Thanks.

Comment on lines 53 to 63
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}
Copy link
Contributor

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

Comment on lines 193 to 201
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
Copy link
Contributor

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.

Copy link
Collaborator Author

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
Copy link
Contributor

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

Comment on lines 187 to 191
variable "SLASH_MIN_PENALTY_PERCENTAGE" {
description = "The slash min penalty percentage"
type = string
default = 0.5
}
Copy link
Contributor

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

Copy link
Collaborator Author

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.

Comment on lines 184 to 209
- 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 }}"
Copy link
Contributor

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?

{{- 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 }}

Copy link
Collaborator Author

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.

@just-mitch just-mitch added this pull request to the merge queue Sep 2, 2025
@just-mitch just-mitch removed this pull request from the merge queue due to a manual request Sep 2, 2025
@just-mitch just-mitch force-pushed the 08-28-mitch_tmnt-225-create-guide-to-run-local-network-tests branch from 09b9452 to 3714c57 Compare September 3, 2025 00:50
@just-mitch
Copy link
Collaborator Author

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.env file
  • 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.tf file (which has its set of defaults)
  • Gets passed onto custom_settings for a helm release resource in a tf definition
  • Gets loaded into helm based on a values.yaml file (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.

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.

@just-mitch just-mitch enabled auto-merge September 3, 2025 00:56
@just-mitch just-mitch force-pushed the 08-28-mitch_tmnt-225-create-guide-to-run-local-network-tests branch from 3714c57 to 0232f6a Compare September 3, 2025 02:38
@just-mitch just-mitch disabled auto-merge September 3, 2025 02:43
@just-mitch just-mitch enabled auto-merge September 3, 2025 02:43
@just-mitch just-mitch force-pushed the 08-28-mitch_tmnt-225-create-guide-to-run-local-network-tests branch from 0232f6a to e0433ce Compare September 3, 2025 02:55
@just-mitch just-mitch force-pushed the 08-28-mitch_tmnt-225-create-guide-to-run-local-network-tests branch from e0433ce to 97d52ef Compare September 3, 2025 03:18
@just-mitch just-mitch added this pull request to the merge queue Sep 3, 2025
Merged via the queue into next with commit b52194c Sep 3, 2025
15 checks passed
@just-mitch just-mitch deleted the 08-28-mitch_tmnt-225-create-guide-to-run-local-network-tests branch September 3, 2025 04:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants