Skip to content
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

chore: 24 second epochs in CI #10646

Merged
merged 8 commits into from
Dec 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -413,17 +413,17 @@ jobs:
matrix:
config:
- test: reorg.test.ts
values: 16-validators
values: ci
runner_type: 16core-tester-x86-high-memory
timeout: 90
timeout: 60
- test: 4epochs.test.ts
values: 16-validators
values: ci
runner_type: 16core-tester-x86
timeout: 60
timeout: 40
# - test: gating-passive.test.ts
# values: 16-validators
# values: ci
# runner_type: 16core-tester-x86
# timeout: 60
# timeout: 40
steps:
- uses: actions/checkout@v4
with: { ref: "${{ env.GIT_COMMIT }}" }
Expand Down
47 changes: 47 additions & 0 deletions spartan/aztec-network/values/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
aztec:
slotDuration: 24
epochDuration: 4
epochProofClaimWindow: 2

ethereum:
blockTime: 8sec

telemetry:
enabled: true

validator:
replicas: 8
validatorKeys:
- 0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80
- 0x59c6995e998f97a5a0044966f0945389dc9e86dae88c7a8412f4603b6b78690d
- 0x5de4111afa1a4b94908f83103eb1f1706367c2e68ca870fc3fb9a804cdab365a
- 0x7c852118294e51e653712a81e05800f419141751be58f605c371e15141b007a6
- 0x47e179ec197488593b187f80a00eb0da91f1b9d0b13f8733639f19c30a34926a
- 0x8b3a350cf5c34c9194ca85829a2df0ec3153be0318b5e2d3348e872092edffba
- 0x92db14e403b83dfe3df233f83dfa3a0d7096f21ca9b0d6d6b8d88b2b4ec1564e
- 0x4bbbf85ce3377467afe5d46f804f221813b2bb87f24d81f60f1fcdbf7cbf4356
validatorAddresses:
- 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266
- 0x70997970C51812dc3A010C7d01b50e0d17dc79C8
- 0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC
- 0x90F79bf6EB2c4f870365E785982E1f101E93b906
- 0x15d34AAf54267DB7D7c367839AAf71A00a2C6A65
- 0x9965507D1a55bcC2695C58ba16FB37d819B0A4dc
- 0x976EA74026E726554dB657fA54763abd0C3a0aa9
- 0x14dC79964da2C08b23698B3D3cc7Ca32193d9955
resources:
requests:
memory: "512Mi"
validator:
disabled: false
sequencer:
enforceTimeTable: false

bot:
followChain: "PENDING"
enabled: true
txIntervalSeconds: 1

bootNode:
validator:
disabled: true
18 changes: 16 additions & 2 deletions yarn-project/end-to-end/scripts/network_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -128,11 +128,13 @@ if [ -z "${CHAOS_VALUES:-}" ]; then
kubectl delete networkchaos --all --all-namespaces
fi

VALUES_PATH="$REPO/spartan/aztec-network/values/$VALUES_FILE"

# Install the Helm chart
helm upgrade --install spartan "$REPO/spartan/aztec-network/" \
--namespace "$NAMESPACE" \
--create-namespace \
--values "$REPO/spartan/aztec-network/values/$VALUES_FILE" \
--values "$VALUES_PATH" \
--set images.aztec.image="aztecprotocol/aztec:$AZTEC_DOCKER_TAG" \
--wait \
--wait-for-jobs=true \
Expand Down Expand Up @@ -164,6 +166,14 @@ if ! handle_network_shaping; then
fi
fi

# Get the values from the values file
VALUES=$(cat "$VALUES_PATH")
ETHEREUM_SLOT_DURATION=$(yq -r '.ethereum.blockTime' <<< "$VALUES")
AZTEC_SLOT_DURATION=$(yq -r '.aztec.slotDuration' <<< "$VALUES")
AZTEC_EPOCH_DURATION=$(yq -r '.aztec.epochDuration' <<< "$VALUES")
AZTEC_EPOCH_PROOF_CLAIM_WINDOW_IN_L2_SLOTS=$(yq -r '.aztec.epochProofClaimWindow' <<< "$VALUES")


docker run --rm --network=host \
-v ~/.kube:/root/.kube \
-e K8S=local \
Expand All @@ -179,5 +189,9 @@ docker run --rm --network=host \
-e GRAFANA_PASSWORD=$GRAFANA_PASSWORD \
-e DEBUG=${DEBUG:-""} \
-e LOG_JSON=1 \
-e LOG_LEVEL=${LOG_LEVEL:-"verbose"} \
-e LOG_LEVEL=${LOG_LEVEL:-"debug; info: aztec:simulator, json-rpc"} \
-e ETHEREUM_SLOT_DURATION=$ETHEREUM_SLOT_DURATION \
-e AZTEC_SLOT_DURATION=$AZTEC_SLOT_DURATION \
-e AZTEC_EPOCH_DURATION=$AZTEC_EPOCH_DURATION \
-e AZTEC_EPOCH_PROOF_CLAIM_WINDOW_IN_L2_SLOTS=$AZTEC_EPOCH_PROOF_CLAIM_WINDOW_IN_L2_SLOTS \
aztecprotocol/end-to-end:$AZTEC_DOCKER_TAG $TEST
9 changes: 2 additions & 7 deletions yarn-project/end-to-end/src/spartan/gating-passive.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,6 @@ describe('a test that passively observes the network in the presence of network

const ETHEREUM_HOST = `http://127.0.0.1:${HOST_ETHEREUM_PORT}`;
const PXE_URL = `http://127.0.0.1:${HOST_PXE_PORT}`;
// 60% is the max that we expect to miss
const MAX_MISSED_SLOT_PERCENT = 0.6;

afterAll(async () => {
await startPortForward({
Expand Down Expand Up @@ -135,16 +133,13 @@ describe('a test that passively observes the network in the presence of network
await sleep(Number(epochDuration * slotDuration) * 1000);
const newTips = await rollupCheatCodes.getTips();

// calculate the percentage of slots missed
// calculate the percentage of slots missed for debugging purposes
const perfectPending = controlTips.pending + BigInt(Math.floor(Number(epochDuration)));
const missedSlots = Number(perfectPending) - Number(newTips.pending);
const missedSlotsPercentage = (missedSlots / Number(epochDuration)) * 100;
debugLogger.info(`Missed ${missedSlots} slots, ${missedSlotsPercentage.toFixed(2)}%`);

// Ensure we missed at most the max allowed slots
// This is in place to ensure that we don't have a bad regression in the network
const maxMissedSlots = Math.floor(Number(epochDuration) * MAX_MISSED_SLOT_PERCENT);
expect(missedSlots).toBeLessThanOrEqual(maxMissedSlots);
expect(newTips.pending).toBeGreaterThan(controlTips.pending);
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

When we have short epochs (e.g. 4), its very reasonable for us to only have 1 block get produced: the nodes that restart could be proposers for all 4 blocks, and it could take about a minute for them to come back online after the restart.

}
});
});
7 changes: 6 additions & 1 deletion yarn-project/end-to-end/src/spartan/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,12 @@ export async function startPortForward({
});

process.stdout?.on('data', data => {
logger.info(data.toString());
const str = data.toString();
if (str.includes('Starting port forward')) {
logger.info(str);
} else {
logger.debug(str);
}
});
process.stderr?.on('data', data => {
// It's a strange thing:
Expand Down
Loading