Skip to content
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
2 changes: 0 additions & 2 deletions yarn-project/end-to-end/src/e2e_p2p/p2p_network.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,8 @@ const l1ContractsConfig = getL1ContractsConfigEnvVars();
export const WAIT_FOR_TX_TIMEOUT = l1ContractsConfig.aztecSlotDuration * 3;

export const SHORTENED_BLOCK_TIME_CONFIG = {
aztecEpochDuration: 4,
aztecSlotDuration: 12,
ethereumSlotDuration: 4,
aztecProofSubmissionWindow: 4 * 2 - 1, // epoch_duration * 2 - 1
};

export class P2PNetworkTest {
Expand Down
4 changes: 2 additions & 2 deletions yarn-project/end-to-end/src/e2e_p2p/reqresp.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,11 @@ describe('e2e_p2p_reqresp_tx', () => {
t.logger.info(`Sending txs to proposer nodes: ${proposerIndexes}`);

// Replace the p2p node implementation of some of the nodes with a spy such that it does not store transactions that are gossiped to it
// Original implementation of `processTxFromPeer` will store received transactions in the tx pool.
// Original implementation of `handleGossipedTx` will store received transactions in the tx pool.
// We chose the first 2 nodes that will be the proposers for the next few slots
for (const nodeIndex of nodesToTurnOffTxGossip) {
jest
.spyOn((nodes[nodeIndex] as any).p2pClient.p2pService, 'processTxFromPeer')
.spyOn((nodes[nodeIndex] as any).p2pClient.p2pService, 'handleGossipedTx')
.mockImplementation((): Promise<void> => {
return Promise.resolve();
});
Expand Down
10 changes: 7 additions & 3 deletions yarn-project/p2p/src/services/libp2p/libp2p_service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -622,9 +622,13 @@ export class LibP2PService<T extends P2PClientType> extends WithTracer implement
public async propagate<T extends Gossipable>(message: T) {
const p2pMessageIdentifier = await message.p2pMessageIdentifier();
this.logger.trace(`Message ${p2pMessageIdentifier} queued`, { p2pMessageIdentifier });
void this.jobQueue.put(async () => {
await this.sendToPeers(message);
});
void this.jobQueue
.put(async () => {
await this.sendToPeers(message);
})
.catch(error => {
Copy link
Member Author

Choose a reason for hiding this comment

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

added this catch

race condition in test where a node would receive a block proposal, begin to process it and the test would end. Stopping the jobQueue, so when it got to propagating the response ( the attestation ) the job queue was stopped, it would throw, and the test would fail

this.logger.error(`Error propagating message ${p2pMessageIdentifier}`, { error });
});
}

/**
Expand Down
2 changes: 0 additions & 2 deletions yarn-project/p2p/src/services/reqresp/reqresp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -607,8 +607,6 @@ export class ReqResp {
const handler = this.subProtocolHandlers[protocol];
const transform = this.snappyTransform;

this.logger.info(`Stream handler for ${protocol}`);

await pipe(
stream,
async function* (source: any) {
Expand Down
Loading