Skip to content

Commit

Permalink
maybe fix
Browse files Browse the repository at this point in the history
  • Loading branch information
dbanks12 committed Jan 6, 2025
1 parent e61d500 commit 359b483
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 29 deletions.
1 change: 0 additions & 1 deletion yarn-project/archiver/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@
"@aztec/foundation": "workspace:^",
"@aztec/kv-store": "workspace:^",
"@aztec/l1-artifacts": "workspace:^",
"@aztec/noir-contracts.js": "workspace:^",
"@aztec/protocol-contracts": "workspace:^",
"@aztec/telemetry-client": "workspace:^",
"@aztec/types": "workspace:^",
Expand Down
26 changes: 1 addition & 25 deletions yarn-project/archiver/src/factory.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,10 @@
import { type ArchiverApi, type Service } from '@aztec/circuit-types';
import {
type ContractClassPublic,
computePublicBytecodeCommitment,
getContractClassFromArtifact,
} from '@aztec/circuits.js';
import { type ContractClassPublic, computePublicBytecodeCommitment } from '@aztec/circuits.js';
import { FunctionSelector, FunctionType } from '@aztec/foundation/abi';
import { createLogger } from '@aztec/foundation/log';
import { type Maybe } from '@aztec/foundation/types';
import { type DataStoreConfig } from '@aztec/kv-store/config';
import { createStore } from '@aztec/kv-store/lmdb';
import { TokenContractArtifact } from '@aztec/noir-contracts.js/Token';
import { TokenBridgeContractArtifact } from '@aztec/noir-contracts.js/TokenBridge';
import { protocolContractNames } from '@aztec/protocol-contracts';
import { getCanonicalProtocolContract } from '@aztec/protocol-contracts/bundle';
import { type TelemetryClient } from '@aztec/telemetry-client';
Expand All @@ -30,7 +24,6 @@ export async function createArchiver(
const store = await createStore('archiver', config, createLogger('archiver:lmdb'));
const archiverStore = new KVArchiverDataStore(store, config.maxLogs);
await registerProtocolContracts(archiverStore);
await registerCommonContracts(archiverStore);
return Archiver.createAndSync(config, archiverStore, telemetry, opts.blockUntilSync);
} else {
return createArchiverClient(config.archiverUrl);
Expand Down Expand Up @@ -60,20 +53,3 @@ async function registerProtocolContracts(store: KVArchiverDataStore) {
await store.addContractInstances([contract.instance], blockNumber);
}
}

// TODO(#10007): Remove this method. We are explicitly registering these contracts
// here to ensure they are available to all nodes and all prover nodes, since the PXE
// was tweaked to automatically push contract classes to the node it is registered,
// but other nodes in the network may require the contract classes to be registered as well.
// TODO(#10007): Remove the dependency on noir-contracts.js from this package once we remove this.
async function registerCommonContracts(store: KVArchiverDataStore) {
const blockNumber = 0;
const artifacts = [TokenBridgeContractArtifact, TokenContractArtifact];
const classes = artifacts.map(artifact => ({
...getContractClassFromArtifact(artifact),
privateFunctions: [],
unconstrainedFunctions: [],
}));
const bytecodeCommitments = classes.map(x => computePublicBytecodeCommitment(x.packedBytecode));
await store.addContractClasses(classes, bytecodeCommitments, blockNumber);
}
3 changes: 0 additions & 3 deletions yarn-project/archiver/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,6 @@
{
"path": "../l1-artifacts"
},
{
"path": "../noir-contracts.js"
},
{
"path": "../protocol-contracts"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,15 @@ import { StatefulTestContract } from '@aztec/noir-contracts.js/StatefulTest';
import { TestContract } from '@aztec/noir-contracts.js/Test';
import { TokenContract } from '@aztec/noir-contracts.js/Token';

import { jest } from '@jest/globals';

import { DeployTest } from './deploy_test.js';

const TIMEOUT = 300_000;

describe('e2e_deploy_contract deploy method', () => {
jest.setTimeout(TIMEOUT);

const t = new DeployTest('deploy method');

let pxe: PXE;
Expand Down

0 comments on commit 359b483

Please sign in to comment.