Skip to content

Commit

Permalink
chore: Rename pxe script generate-package-info to generate (#10534)
Browse files Browse the repository at this point in the history
This ensures the command is caught by the `yarn generate` step for the
`build:fast` script in the root package.json.

---------

Co-authored-by: Gregorio Juliana <[email protected]>
  • Loading branch information
spalladino and Thunkar authored Dec 9, 2024
1 parent cce7b99 commit ead9c0b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 9 deletions.
8 changes: 4 additions & 4 deletions yarn-project/pxe/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -112,4 +112,4 @@
"engines": {
"node": ">=18"
}
}
}
4 changes: 2 additions & 2 deletions yarn-project/pxe/package.local.json
Original file line number Diff line number Diff line change
@@ -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"
}
}
5 changes: 2 additions & 3 deletions yarn-project/pxe/src/synchronizer/synchronizer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit ead9c0b

Please sign in to comment.