Skip to content

Commit

Permalink
fix: update artifact hash + sequencer config
Browse files Browse the repository at this point in the history
  • Loading branch information
LHerskind committed Nov 27, 2024
1 parent e4e604c commit f25b63b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 21 deletions.
10 changes: 4 additions & 6 deletions yarn-project/circuits.js/src/contract/artifact_hash.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ import { readFileSync } from 'fs';
import { getPathToFixture, getTestContractArtifact } from '../tests/fixtures.js';
import { computeArtifactHash } from './artifact_hash.js';

const TEST_CONTRACT_ARTIFACT_HASH = `"0x08f4e5d2a0be9dc5c31894f88aaa93d353918078cd7fdfbbc7818ec3f2268b77"`;

describe('ArtifactHash', () => {
it('calculates the artifact hash', () => {
const emptyArtifact: ContractArtifact = {
Expand All @@ -29,9 +31,7 @@ describe('ArtifactHash', () => {
const testArtifact = getTestContractArtifact();

for (let i = 0; i < 1000; i++) {
expect(computeArtifactHash(testArtifact).toString()).toMatchInlineSnapshot(
`"0x21070d88558fdc3906322f267cf6f0f632caf3949295520fe1f71f156fbb0d0b"`,
);
expect(computeArtifactHash(testArtifact).toString()).toMatchInlineSnapshot(TEST_CONTRACT_ARTIFACT_HASH);
}
});

Expand All @@ -42,8 +42,6 @@ describe('ArtifactHash', () => {

const testArtifact = loadContractArtifact(content);

expect(computeArtifactHash(testArtifact).toString()).toMatchInlineSnapshot(
`"0x21070d88558fdc3906322f267cf6f0f632caf3949295520fe1f71f156fbb0d0b"`,
);
expect(computeArtifactHash(testArtifact).toString()).toMatchInlineSnapshot(TEST_CONTRACT_ARTIFACT_HASH);
});
});
21 changes: 6 additions & 15 deletions yarn-project/end-to-end/src/e2e_fees/gas_estimation.test.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { type AztecNodeService } from '@aztec/aztec-node';
import {
type AccountWallet,
type AztecAddress,
Expand Down Expand Up @@ -72,23 +73,13 @@ describe('e2e_fees gas_estimation', () => {
});
logGasEstimate(estimatedGas);

(t.aztecNode as AztecNodeService).getSequencer()!.updateSequencerConfig({ minTxsPerBlock: 2, maxTxsPerBlock: 2 });

const [withEstimate, withoutEstimate] = await sendTransfers(paymentMethod);

if (withEstimate.blockNumber !== withoutEstimate.blockNumber) {
// The two txs are in different blocks
// Sums are not so interesting when there is only one element.

expect((await t.pxe.getBlock(withEstimate.blockNumber!))!.header.totalManaUsed.toNumber()).toBe(
estimatedGas.gasLimits.l2Gas,
);
expect((await t.pxe.getBlock(withoutEstimate.blockNumber!))!.header.totalManaUsed.toNumber()).toBe(
estimatedGas.gasLimits.l2Gas,
);
} else {
// This is the interesting case, which we hit most of the time.
const block = await t.pxe.getBlock(withEstimate.blockNumber!);
expect(block!.header.totalManaUsed.toNumber()).toBe(estimatedGas.gasLimits.l2Gas * 2);
}
// This is the interesting case, which we hit most of the time.
const block = await t.pxe.getBlock(withEstimate.blockNumber!);
expect(block!.header.totalManaUsed.toNumber()).toBe(estimatedGas.gasLimits.l2Gas * 2);

// Tx has no teardown cost, so both fees should just reflect the actual gas cost.
expect(withEstimate.transactionFee!).toEqual(withoutEstimate.transactionFee!);
Expand Down

0 comments on commit f25b63b

Please sign in to comment.