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: bigint corruption in lmdb #6002

Merged
merged 1 commit into from
Apr 25, 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
Expand Up @@ -29,6 +29,7 @@ describe('e2e_2_pxes', () => {
let walletB: Wallet;
let logger: DebugLogger;
let teardownA: () => Promise<void>;
let teardownB: () => Promise<void>;

beforeEach(async () => {
({
Expand All @@ -42,14 +43,13 @@ describe('e2e_2_pxes', () => {
({
pxe: pxeB,
wallets: [walletB],
teardown: teardownB,
} = await setupPXEService(1, aztecNode!, {}, undefined, true));
}, 100_000);

afterEach(async () => {
await teardownB();
await teardownA();
if ((pxeB as any).stop) {
await (pxeB as any).stop();
}
});

const awaitUserSynchronized = async (wallet: Wallet, owner: AztecAddress) => {
Expand Down
9 changes: 9 additions & 0 deletions yarn-project/end-to-end/src/fixtures/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -196,16 +196,25 @@ export async function setupPXEService(
* Logger instance named as the current test.
*/
logger: DebugLogger;
/**
* Teardown function
*/
teardown: () => Promise<void>;
}> {
const pxeServiceConfig = { ...getPXEServiceConfig(), ...opts };
const pxe = await createPXEService(aztecNode, pxeServiceConfig, useLogSuffix);

const wallets = await createAccounts(pxe, numberOfAccounts);

const teardown = async () => {
await pxe.stop();
};

return {
pxe,
wallets,
logger,
teardown,
};
}

Expand Down
2 changes: 1 addition & 1 deletion yarn-project/pxe/src/database/kv_pxe_database.ts
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ export class KVPxeDatabase implements PxeDatabase {
removeDeferredNotesByContract(contractAddress: AztecAddress): Promise<DeferredNoteDao[]> {
return this.#db.transaction(() => {
const deferredNotes: DeferredNoteDao[] = [];
const indices = this.#deferredNotesByContract.getValues(contractAddress.toString());
const indices = Array.from(this.#deferredNotesByContract.getValues(contractAddress.toString()));

for (const index of indices) {
const deferredNoteBuffer = this.#deferredNotes.at(index);
Expand Down
Loading