From 1e8247b9b9af2dea9e228da717ebca3b110fa1f0 Mon Sep 17 00:00:00 2001 From: Mitch Date: Mon, 7 Oct 2024 05:25:47 -0400 Subject: [PATCH] fix: use properly sized p2p id also fix network test to look at correct namespace add helper test for debugging the rollup within the smoke test --- .../prover_coordination/epoch_proof_quote.ts | 5 ++-- .../end-to-end/scripts/network_test.sh | 8 ++--- .../end-to-end/src/spartan/smoke.test.ts | 30 +++++++++++++++++++ 3 files changed, 35 insertions(+), 8 deletions(-) diff --git a/yarn-project/circuit-types/src/prover_coordination/epoch_proof_quote.ts b/yarn-project/circuit-types/src/prover_coordination/epoch_proof_quote.ts index cfa073407cf..a26de238aa6 100644 --- a/yarn-project/circuit-types/src/prover_coordination/epoch_proof_quote.ts +++ b/yarn-project/circuit-types/src/prover_coordination/epoch_proof_quote.ts @@ -1,5 +1,5 @@ import { Buffer32 } from '@aztec/foundation/buffer'; -import { type Secp256k1Signer } from '@aztec/foundation/crypto'; +import { type Secp256k1Signer, keccak256 } from '@aztec/foundation/crypto'; import { Signature } from '@aztec/foundation/eth-signature'; import { BufferReader, serializeToBuffer } from '@aztec/foundation/serialize'; import { type FieldsOf } from '@aztec/foundation/types'; @@ -20,7 +20,8 @@ export class EpochProofQuote extends Gossipable { } override p2pMessageIdentifier(): Buffer32 { - return new Buffer32(this.signature.toBuffer()); + // TODO: https://github.com/AztecProtocol/aztec-packages/issues/8911 + return new Buffer32(keccak256(this.signature.toBuffer())); } override toBuffer(): Buffer { diff --git a/yarn-project/end-to-end/scripts/network_test.sh b/yarn-project/end-to-end/scripts/network_test.sh index 00e58e54f4a..42498330af4 100755 --- a/yarn-project/end-to-end/scripts/network_test.sh +++ b/yarn-project/end-to-end/scripts/network_test.sh @@ -47,7 +47,7 @@ function show_status_until_pxe_ready() { set +x # don't spam with our commands sleep 15 # let helm upgrade start for i in {1..100} ; do - if kubectl wait pod -l app==pxe --for=condition=Ready -n "transfer" --timeout=20s >/dev/null 2>/dev/null ; then + if kubectl wait pod -l app==pxe --for=condition=Ready -n "$NAMESPACE" --timeout=20s >/dev/null 2>/dev/null ; then break # we are up, stop showing status fi # show startup status @@ -70,12 +70,8 @@ helm upgrade --install spartan "$(git rev-parse --show-toplevel)/spartan/aztec-n kubectl wait pod -l app==pxe --for=condition=Ready -n "$NAMESPACE" --timeout=10m -function forward_pxe_k8s_port() { - # NOTE we fail silently, and work in the background - kubectl port-forward --namespace transfer svc/spartan-aztec-network-pxe 9082:8080 2>/dev/null >/dev/null || true -} # tunnel in to get access directly to our PXE service in k8s -(kubectl port-forward --namespace transfer svc/spartan-aztec-network-pxe 9082:8080 2>/dev/null >/dev/null || true) & +(kubectl port-forward --namespace $NAMESPACE svc/spartan-aztec-network-pxe 9082:8080 2>/dev/null >/dev/null || true) & # run our test in the host network namespace (so we can access the above with localhost) docker run --rm --network=host \ diff --git a/yarn-project/end-to-end/src/spartan/smoke.test.ts b/yarn-project/end-to-end/src/spartan/smoke.test.ts index f1a58fa1731..867c4ff1688 100644 --- a/yarn-project/end-to-end/src/spartan/smoke.test.ts +++ b/yarn-project/end-to-end/src/spartan/smoke.test.ts @@ -19,4 +19,34 @@ describe('sample test', () => { // expect enr to be a string starting with 'enr:-' expect(info.enr).toMatch(/^enr:-/); }); + + /** + * Leaving this test commented out because it requires the ethereum node + * to be running and forwarded, e.g. + * kubectl port-forward -n smoke service/spartan-aztec-network-ethereum 8545:8545 + + it('should be able to get rollup info', async () => { + const info = await pxe.getNodeInfo(); + const publicClient = createPublicClient({ + chain: foundry, + transport: http('http://localhost:8545'), + }); + + const rollupContract = getContract({ + address: getAddress(info.l1ContractAddresses.rollupAddress.toString()), + abi: RollupAbi, + client: publicClient, + }); + + // eslint-disable-next-line @typescript-eslint/no-unused-vars + const [pendingBlockNum, pendingArchive, provenBlockNum, provenArchive, myArchive, provenEpochNumber] = + await rollupContract.read.status([60n]); + console.log('pendingBlockNum', pendingBlockNum.toString()); + console.log('pendingArchive', pendingArchive.toString()); + console.log('provenBlockNum', provenBlockNum.toString()); + console.log('provenArchive', provenArchive.toString()); + console.log('myArchive', myArchive.toString()); + console.log('provenEpochNumber', provenEpochNumber.toString()); + }); + */ });