diff --git a/yarn-project/pxe/package.json b/yarn-project/pxe/package.json index 69ced063f46..043184ef30c 100644 --- a/yarn-project/pxe/package.json +++ b/yarn-project/pxe/package.json @@ -18,14 +18,14 @@ "tsconfig": "./tsconfig.json" }, "scripts": { - "build": "yarn clean && yarn generate:package_info && tsc -b", + "build": "yarn clean && yarn generate && tsc -b", "build:dev": "tsc -b --watch", "clean": "rm -rf ./dest .tsbuildinfo ./src/config/package_info.ts", "formatting": "run -T prettier --check ./src && run -T eslint ./src", "formatting:fix": "run -T eslint --fix ./src && run -T prettier -w ./src", - "generate:package_info": "node ./scripts/generate_package_info.js", "test": "NODE_NO_WARNINGS=1 node --experimental-vm-modules ../node_modules/.bin/jest --passWithNoTests", - "start": "DEBUG='aztec:*' && node ./dest/bin/index.js" + "start": "DEBUG='aztec:*' && node ./dest/bin/index.js", + "generate": "node ./scripts/generate_package_info.js" }, "inherits": [ "../package.common.json", @@ -112,4 +112,4 @@ "engines": { "node": ">=18" } -} +} \ No newline at end of file diff --git a/yarn-project/pxe/package.local.json b/yarn-project/pxe/package.local.json index ee72375cfea..57dfa9d69aa 100644 --- a/yarn-project/pxe/package.local.json +++ b/yarn-project/pxe/package.local.json @@ -1,7 +1,7 @@ { "scripts": { - "build": "yarn clean && yarn generate:package_info && tsc -b", + "build": "yarn clean && yarn generate && tsc -b", "clean": "rm -rf ./dest .tsbuildinfo ./src/config/package_info.ts", - "generate:package_info": "node ./scripts/generate_package_info.js" + "generate": "node ./scripts/generate_package_info.js" } } \ No newline at end of file diff --git a/yarn-project/pxe/src/synchronizer/synchronizer.ts b/yarn-project/pxe/src/synchronizer/synchronizer.ts index 6948f902ba1..a8224e591ee 100644 --- a/yarn-project/pxe/src/synchronizer/synchronizer.ts +++ b/yarn-project/pxe/src/synchronizer/synchronizer.ts @@ -82,14 +82,13 @@ export class Synchronizer implements L2BlockStreamEventHandler { let currentHeader; try { - currentHeader = this.db.getBlockHeader(); + currentHeader = await this.db.getBlockHeader(); } catch (e) { this.log.debug('Header is not set, requesting from the node'); } if (!currentHeader) { // REFACTOR: We should know the header of the genesis block without having to request it from the node. - const storedBlockNumber = await this.db.getBlockNumber(); - await this.db.setHeader(await this.node.getBlockHeader(storedBlockNumber ?? 0)); + await this.db.setHeader(await this.node.getBlockHeader(0)); } await this.trigger();