Skip to content

Commit fe6c81d

Browse files
committed
perf(e2e): parallelize dual token mints
applyFundAliceWithBananas sent Alice's private and public banana mints back-to-back, paying one production slot each. The two mints touch disjoint balances, so they are now sent concurrently and share a slot. Each mint keeps its own tx:mint span, so the overlap shows up as busyMs < totalMs in the timing data.
1 parent 8b16fc8 commit fe6c81d

1 file changed

Lines changed: 10 additions & 6 deletions

File tree

yarn-project/end-to-end/src/single-node/fees/fees_test.ts

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -408,12 +408,16 @@ export class FeesTest extends SingleNodeTestContext {
408408
public async applyFundAliceWithBananas() {
409409
this.logger.info('Applying fund Alice with bananas setup');
410410

411-
await this.mintPrivateBananas(this.ALICE_INITIAL_BANANAS, this.aliceAddress);
412-
await testSpan('tx:mint', () =>
413-
this.bananaCoin.methods.mint_to_public(this.aliceAddress, this.ALICE_INITIAL_BANANAS).send({
414-
from: this.aliceAddress,
415-
}),
416-
);
411+
// The private and public mints touch disjoint balances, so they are sent concurrently to share a
412+
// slot instead of paying one slot each.
413+
await Promise.all([
414+
this.mintPrivateBananas(this.ALICE_INITIAL_BANANAS, this.aliceAddress),
415+
testSpan('tx:mint', () =>
416+
this.bananaCoin.methods.mint_to_public(this.aliceAddress, this.ALICE_INITIAL_BANANAS).send({
417+
from: this.aliceAddress,
418+
}),
419+
),
420+
]);
417421
}
418422

419423
public async applyFundAliceWithPrivateBananas() {

0 commit comments

Comments
 (0)