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

fix: use properly sized p2p id #9040

Merged
merged 1 commit into from
Oct 7, 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
Original file line number Diff line number Diff line change
@@ -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';
Expand All @@ -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 {
Expand Down
8 changes: 2 additions & 6 deletions yarn-project/end-to-end/scripts/network_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 \
Expand Down
30 changes: 30 additions & 0 deletions yarn-project/end-to-end/src/spartan/smoke.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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());
});
*/
});
Loading