-
Notifications
You must be signed in to change notification settings - Fork 234
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: prove one epoch in kind (#9886)
Please read [contributing guidelines](CONTRIBUTING.md) and remove this line.
- Loading branch information
Showing
8 changed files
with
195 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
48 changes: 48 additions & 0 deletions
48
spartan/aztec-network/values/1-validator-with-proving-and-metrics.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
validator: | ||
replicas: 1 | ||
validatorKeys: | ||
- 0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 | ||
validatorAddresses: | ||
- 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 | ||
validator: | ||
disabled: false | ||
|
||
bootNode: | ||
validator: | ||
disabled: true | ||
|
||
proverNode: | ||
realProofs: true | ||
|
||
proverAgent: | ||
replicas: 6 | ||
realProofs: true | ||
bb: | ||
hardwareConcurrency: 16 | ||
resources: | ||
requests: | ||
memory: "64Gi" | ||
cpu: "16" | ||
limits: | ||
memory: "96Gi" | ||
cpu: "16" | ||
|
||
pxe: | ||
proverEnabled: true | ||
|
||
bot: | ||
enabled: true | ||
pxeProverEnabled: true | ||
txIntervalSeconds: 200 | ||
|
||
jobs: | ||
deployL1Verifier: | ||
enable: true | ||
|
||
aztec: | ||
slotDuration: 36 | ||
epochDuration: 32 | ||
|
||
telemetry: | ||
enabled: true | ||
otelCollectorEndpoint: http://metrics-opentelemetry-collector.metrics:4318 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
import { type PXE, createCompatibleClient, sleep } from '@aztec/aztec.js'; | ||
import { createDebugLogger } from '@aztec/foundation/log'; | ||
|
||
import { jest } from '@jest/globals'; | ||
import { type ChildProcess } from 'child_process'; | ||
|
||
import { getConfig, isK8sConfig, startPortForward } from './k8_utils.js'; | ||
|
||
jest.setTimeout(2_400_000); // 40 minutes | ||
|
||
const config = getConfig(process.env); | ||
const debugLogger = createDebugLogger('aztec:spartan-test:proving'); | ||
const SLEEP_MS = 1000; | ||
|
||
describe('proving test', () => { | ||
let pxe: PXE; | ||
let proc: ChildProcess | undefined; | ||
beforeAll(async () => { | ||
let PXE_URL; | ||
if (isK8sConfig(config)) { | ||
proc = await startPortForward({ | ||
resource: 'svc/spartan-aztec-network-pxe', | ||
namespace: config.NAMESPACE, | ||
containerPort: config.CONTAINER_PXE_PORT, | ||
hostPort: config.HOST_PXE_PORT, | ||
}); | ||
PXE_URL = `http://127.0.0.1:${config.HOST_PXE_PORT}`; | ||
} else { | ||
PXE_URL = config.PXE_URL; | ||
} | ||
pxe = await createCompatibleClient(PXE_URL, debugLogger); | ||
}); | ||
|
||
afterAll(() => { | ||
proc?.kill('SIGKILL'); | ||
}); | ||
|
||
it('advances the proven chain', async () => { | ||
let [provenBlockNumber, blockNumber] = await Promise.all([pxe.getProvenBlockNumber(), pxe.getBlockNumber()]); | ||
let ok: boolean; | ||
|
||
debugLogger.info(`Initial pending chain tip: ${blockNumber}`); | ||
debugLogger.info(`Initial proven chain tip: ${provenBlockNumber}`); | ||
|
||
while (true) { | ||
const [newProvenBlockNumber, newBlockNumber] = await Promise.all([ | ||
pxe.getProvenBlockNumber(), | ||
pxe.getBlockNumber(), | ||
]); | ||
|
||
if (newBlockNumber > blockNumber) { | ||
debugLogger.info(`Pending chain has advanced: ${blockNumber} -> ${newBlockNumber}`); | ||
} else if (newBlockNumber < blockNumber) { | ||
debugLogger.error(`Pending chain has been pruned: ${blockNumber} -> ${newBlockNumber}`); | ||
ok = false; | ||
break; | ||
} | ||
|
||
if (newProvenBlockNumber > provenBlockNumber) { | ||
debugLogger.info(`Proven chain has advanced: ${provenBlockNumber} -> ${newProvenBlockNumber}`); | ||
ok = true; | ||
break; | ||
} | ||
|
||
provenBlockNumber = newProvenBlockNumber; | ||
blockNumber = newBlockNumber; | ||
|
||
await sleep(SLEEP_MS); | ||
} | ||
|
||
expect(ok).toBeTrue(); | ||
}); | ||
}); |