From d9decd5a589bc446e439117ff265664c37142412 Mon Sep 17 00:00:00 2001 From: Alex Gherghisan Date: Tue, 16 Apr 2024 20:37:31 +0000 Subject: [PATCH] fix: set gas settings in bench --- .circleci/config.yml | 22 +++++++++---------- .../src/benchmarks/bench_tx_size_fees.test.ts | 10 +++++++-- 2 files changed, 19 insertions(+), 13 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index fd4aec7d778..6b4c8af64ae 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -551,15 +551,15 @@ jobs: aztec_manifest_key: end-to-end <<: *defaults_e2e_test - # bench-tx-size: - # steps: - # - *checkout - # - *setup_env - # - run: - # name: "Benchmark" - # command: cond_spot_run_compose end-to-end 4 ./scripts/docker-compose-no-sandbox.yml TEST=benchmarks/bench_tx_size_fees.test.ts ENABLE_GAS=1 DEBUG=aztec:benchmarks:*,aztec:sequencer,aztec:sequencer:*,aztec:world_state,aztec:merkle_trees - # aztec_manifest_key: end-to-end - # <<: *defaults_e2e_test + bench-tx-size: + steps: + - *checkout + - *setup_env + - run: + name: "Benchmark" + command: cond_spot_run_compose end-to-end 4 ./scripts/docker-compose-no-sandbox.yml TEST=benchmarks/bench_tx_size_fees.test.ts ENABLE_GAS=1 DEBUG=aztec:benchmarks:*,aztec:sequencer,aztec:sequencer:*,aztec:world_state,aztec:merkle_trees + aztec_manifest_key: end-to-end + <<: *defaults_e2e_test build-docs: machine: @@ -900,12 +900,12 @@ workflows: # Benchmark jobs. - bench-publish-rollup: *e2e_test - bench-process-history: *e2e_test - # - bench-tx-size: *e2e_test + - bench-tx-size: *e2e_test - bench-summary: requires: - bench-publish-rollup - bench-process-history - # - bench-tx-size + - bench-tx-size <<: *defaults # Production releases. diff --git a/yarn-project/end-to-end/src/benchmarks/bench_tx_size_fees.test.ts b/yarn-project/end-to-end/src/benchmarks/bench_tx_size_fees.test.ts index 2d4009042a0..c2bbcc8ceb8 100644 --- a/yarn-project/end-to-end/src/benchmarks/bench_tx_size_fees.test.ts +++ b/yarn-project/end-to-end/src/benchmarks/bench_tx_size_fees.test.ts @@ -8,7 +8,7 @@ import { PublicFeePaymentMethod, TxStatus, } from '@aztec/aztec.js'; -import { GasSettings } from '@aztec/circuits.js'; +import { Fr, GasSettings } from '@aztec/circuits.js'; import { FPCContract, GasTokenContract, TokenContract } from '@aztec/noir-contracts.js'; import { getCanonicalGasTokenAddress } from '@aztec/protocol-contracts/gas-token'; @@ -68,9 +68,15 @@ describe('benchmarks/tx_size_fees', () => { () => Promise.resolve(new PrivateFeePaymentMethod(token.address, fpc.address, aliceWallet)), ])('sends a tx with a fee', async createPaymentMethod => { const paymentMethod = await createPaymentMethod(); + const gasSettings = GasSettings.new({ + da: { gasLimit: 5, teardownGasLimit: 3, maxFeePerGas: Fr.ONE }, + l1: { gasLimit: 5, teardownGasLimit: 3, maxFeePerGas: Fr.ONE }, + l2: { gasLimit: 5, teardownGasLimit: 3, maxFeePerGas: Fr.ONE }, + inclusionFee: new Fr(6), + }); const tx = await token.methods .transfer(aliceWallet.getAddress(), bobAddress, 1n, 0) - .send({ fee: paymentMethod ? { gasSettings: GasSettings.empty(), paymentMethod } : undefined }) + .send({ fee: paymentMethod ? { gasSettings, paymentMethod } : undefined }) .wait(); expect(tx.status).toEqual(TxStatus.MINED);