diff --git a/.vscode/settings.json b/.vscode/settings.json index 9d6d5e157..e580ce2aa 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -5,5 +5,6 @@ }, "prettier.prettierPath": ".yarn/sdks/prettier/index.js", "typescript.tsdk": ".yarn/sdks/typescript/lib", - "typescript.enablePromptUseWorkspaceTsdk": true + "typescript.enablePromptUseWorkspaceTsdk": true, + "cmake.sourceDirectory": "/home/emilivanichkov/code/repos/metacraft-labs/DendrETH/.yarn/unplugged/bcrypto-npm-5.5.2-f3838b92ce/node_modules/bcrypto" } diff --git a/beacon-light-client/circom/tsconfig.json b/beacon-light-client/circom/tsconfig.json index f8b84c589..985fa853b 100644 --- a/beacon-light-client/circom/tsconfig.json +++ b/beacon-light-client/circom/tsconfig.json @@ -2,7 +2,8 @@ "extends": "../../tsconfig.hardhat.json", "include": [ "./scripts/**/*.ts", - "./test/**/*.ts" + "./test/**/*.ts", + "**/*.json" ], "files": [ "./hardhat.config.ts" diff --git a/beacon-light-client/plonky2/input_fetchers/tsconfig.json b/beacon-light-client/plonky2/input_fetchers/tsconfig.json index 618c6c3e9..e316e9ee8 100644 --- a/beacon-light-client/plonky2/input_fetchers/tsconfig.json +++ b/beacon-light-client/plonky2/input_fetchers/tsconfig.json @@ -1,3 +1,10 @@ { - "extends": "../../../tsconfig.json" + "extends": "../../../tsconfig.json", + "compilerOptions": { + "baseUrl": ".", + "paths": { + "@/*": ["./*"], + "@/abi": ["./balance_verification/abi/"], + } + }, } diff --git a/beacon-light-client/solidity/hardhat.config.ts b/beacon-light-client/solidity/hardhat.config.ts index 1a0fe2c83..2ab1ddda6 100644 --- a/beacon-light-client/solidity/hardhat.config.ts +++ b/beacon-light-client/solidity/hardhat.config.ts @@ -1,5 +1,12 @@ require('dotenv').config(); +require('tsconfig-paths').register({ + baseUrl: './', + paths: { + '@/*': ['../../relay/*'], + }, +}); + // Disabled due to compatibility issues with pnpapi // TODO: Replace with modern alternative // import 'hardhat-gas-reporter'; diff --git a/beacon-light-client/solidity/package.json b/beacon-light-client/solidity/package.json index 59f0876db..40be8836c 100644 --- a/beacon-light-client/solidity/package.json +++ b/beacon-light-client/solidity/package.json @@ -48,6 +48,7 @@ "chai-as-promised": "^7.1.2", "dotenv": "^16.4.4", "env-paths": "^3.0.0", + "tsconfig-paths": "^4.2.0", "typescript": "5.2.2" }, "exports": { diff --git a/beacon-light-client/solidity/tsconfig.json b/beacon-light-client/solidity/tsconfig.json index cbd5af417..7f8441025 100644 --- a/beacon-light-client/solidity/tsconfig.json +++ b/beacon-light-client/solidity/tsconfig.json @@ -1,10 +1,17 @@ { "extends": "../../tsconfig.hardhat.json", "files": [ - "./hardhat.config.ts" + "./hardhat.config.ts", ], + "compilerOptions": { + "composite": true, + }, + "references": [ + { + "path":"../../relay" + }], "include": [ "./tasks", - "./test" + "./test", ], } diff --git a/package.json b/package.json index 4cf2ff360..eefa37680 100644 --- a/package.json +++ b/package.json @@ -55,7 +55,7 @@ "clean:normal": "yarn clean:jest && EXCL_NM='-e node_modules' yarn clean:untracked_artifacts", "clean:jest": "jest --clear-cache", "clean:untracked_artifacts": "git clean -fdx -e .env -e .direnv -e .yarn -e .vscode $EXCL_NM -- $(git rev-parse --show-toplevel)", - "check:build": "cd beacon-light-client/solidity/ && yarn build:sol && cd ../../ && yarn tsc", + "check:build": "cd beacon-light-client/solidity/ && yarn build:sol && cd ../../ && yarn tsc -b ./tsconfig.json", "format:check": "prettier --check . && alejandra --exclude ./.yarn --exclude ./node_modules --exclude ./yarn-project.nix --check .", "format:write": "prettier --write . && alejandra --exclude ./.yarn --exclude ./node_modules --exclude ./yarn-project.nix .", "test": "jest --verbose --silent -i", @@ -109,6 +109,9 @@ "get-changed-validators": "dist/beacon-light-client/plonky2/validators_commitment_mapper_tree/get_changed_validators.js" }, "dependenciesMeta": { + "@lodestar/types@1.17.0": { + "unplugged": true + }, "@openzeppelin/contracts@5.0.2": { "unplugged": true }, diff --git a/relay/implementations/beacon-api.ts b/relay/implementations/beacon-api.ts index b9e3186a6..1847215e8 100644 --- a/relay/implementations/beacon-api.ts +++ b/relay/implementations/beacon-api.ts @@ -21,7 +21,7 @@ import { panic, sleep } from '@dendreth/utils/ts-utils/common-utils'; import EventSource from 'eventsource'; // @ts-ignore import { StateId } from '@lodestar/api/beacon/routes/beacon'; - +// import '@/x'; const logger = getGenericLogger(); export async function getBeaconApi( diff --git a/relay/implementations/eos-contract.ts b/relay/implementations/eos-contract.ts index 5992a2b01..c9d48ba04 100644 --- a/relay/implementations/eos-contract.ts +++ b/relay/implementations/eos-contract.ts @@ -1,8 +1,6 @@ import { ISmartContract } from '@/abstraction/smart-contract-abstraction'; import { promisify } from 'node:util'; import { exec as exec_ } from 'node:child_process'; -import { compileVerifierParseDataTool } from '../../tests/helpers/helpers'; -import { getDataFromPrintHeaderResult } from '@dendreth/utils/cosmos-utils/cosmos-utils'; import { formatHex } from '@dendreth/utils/ts-utils/bls'; import { getGenericLogger } from '@dendreth/utils/ts-utils/logger'; diff --git a/relay/tsconfig.json b/relay/tsconfig.json index 0c1da4aca..e5931423f 100644 --- a/relay/tsconfig.json +++ b/relay/tsconfig.json @@ -1,9 +1,13 @@ { "extends": "../tsconfig.json", "compilerOptions": { + "composite": true, + "rootDir": "../", "baseUrl": ".", "paths": { - "@/*": ["./*"] + "@/*": ["./*"], + "@/x": ["../.yarn/unplugged/@lodestar-types-npm-1.17.0-1607a25762/node_modules/@lodestar/types/lib/utils/executionAddress"] } - } + }, + "include": ["**/*.ts", "constants/network_config.json", "../beacon-light-client/plonky2/kv_db_constants.json"], } diff --git a/relay/utils/discord_monitor.ts b/relay/utils/discord_monitor.ts index ddc3a94a7..df6df427b 100644 --- a/relay/utils/discord_monitor.ts +++ b/relay/utils/discord_monitor.ts @@ -4,6 +4,7 @@ import { ethers } from 'ethers'; import { sleep } from '@dendreth/utils/ts-utils/common-utils'; import { GatewayIntentBits, Events, Partials } from 'discord.js'; import * as Discord from 'discord.js'; +// @ts-ignore import lc_abi_json from '@dendreth/solidity/artifacts/BeaconLightClient.json'; const env = process.env; diff --git a/tsconfig.json b/tsconfig.json index a77d802da..e771a5cbf 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -3,7 +3,7 @@ /* Visit https://aka.ms/tsconfig to read more about this file */ /* Projects */ // "incremental": true, /* Save .tsbuildinfo files to allow for incremental compilation of projects. */ - // "composite": true, /* Enable constraints that allow a TypeScript project to be used with project references. */ + "composite": true, /* Enable constraints that allow a TypeScript project to be used with project references. */ // "tsBuildInfoFile": "./.tsbuildinfo", /* Specify the path to .tsbuildinfo incremental compilation file. */ // "disableSourceOfProjectReferenceRedirect": true, /* Disable preferring source files instead of declaration files when referencing composite projects. */ // "disableSolutionSearching": true, /* Opt a project out of multi-project reference checking when editing. */ @@ -24,7 +24,7 @@ /* Modules */ "module": "ESNext", /* Specify what module code is generated. */ "moduleResolution": "Bundler", /* Specify how TypeScript looks up a file from a given module specifier. */ - // "rootDir": "./", /* Specify the root folder within your source files. */ + "rootDir": "./", /* Specify the root folder within your source files. */ // "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */ // "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */ // "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */ @@ -41,8 +41,8 @@ // "checkJs": true, /* Enable error reporting in type-checked JavaScript files. */ // "maxNodeModuleJsDepth": 1, /* Specify the maximum folder depth used for checking JavaScript files from 'node_modules'. Only applicable with 'allowJs'. */ /* Emit */ - // "declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */ - // "declarationMap": true, /* Create sourcemaps for d.ts files. */ + "declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */ + "declarationMap": true, /* Create sourcemaps for d.ts files. */ // "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */ // "sourceMap": true, /* Create source map files for emitted JavaScript files. */ // "outFile": "./", /* Specify a file that bundles all outputs into one JavaScript file. If 'declaration' is true, also designates a file that bundles all .d.ts output. */ @@ -97,5 +97,15 @@ "exclude": [ "node_modules", "vendor", - ] + + ], + "references": [ + { + "path":"./relay" + }], + "files": ["vendor/eth2-light-client-updates/mainnet/bootstrap.json", + "vendor/eth2-light-client-updates/mainnet/updates/00290.json", + "vendor/eth2-light-client-updates/prater/capella-updates-94/update_5601823_5609044.json"], + "include": ["**/*.ts", "**/*.json"] + } diff --git a/yarn-project.nix b/yarn-project.nix index 271a0b11a..655681739 100644 --- a/yarn-project.nix +++ b/yarn-project.nix @@ -52,7 +52,7 @@ let rm $out/.gitignore ''; outputHashMode = "recursive"; - outputHash = "sha512-8jmYm01fpJ6mAmJjdI4q8rXx/jNlyNjRj62R2X28yw+HgxXs/QdhMnFaFYvzbkYQicMHEEJvXUkEvIgf6trkRQ=="; + outputHash = "sha512-XnZrzm0RE8x/CgIUUmGGlw9H8QV6UfeVj/+GJ5+/QGZ0cE/b3TgjQJRqQY4fAPd6fT4CUi5KGh1v3jmSQ0TaPQ=="; }; # Create a derivation that builds a module in isolation. diff --git a/yarn.lock b/yarn.lock index e9a8ff628..07fb39b5c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1684,6 +1684,7 @@ __metadata: r1csfile: "npm:^0.0.40" snarkjs: "https://github.com/metacraft-labs/snarkjs.git#commit=091ee9c3744c660b0ecd961f9197a8249a8f7d3b" ts-node: "npm:^10.9.1" + tsconfig-paths: "npm:^4.2.0" typescript: "npm:5.2.2" web3: "npm:1.10.4" languageName: unknown @@ -5203,6 +5204,8 @@ __metadata: winston: "npm:^3.10.0" yargs: "npm:^17.7.2" dependenciesMeta: + "@lodestar/types@1.17.0": + unplugged: true "@openzeppelin/contracts@5.0.2": unplugged: true circomlib@2.0.2: @@ -10765,7 +10768,7 @@ __metadata: languageName: node linkType: hard -"json5@npm:^2.1.1, json5@npm:^2.2.3": +"json5@npm:^2.1.1, json5@npm:^2.2.2, json5@npm:^2.2.3": version: 2.2.3 resolution: "json5@npm:2.2.3" bin: @@ -14222,6 +14225,13 @@ __metadata: languageName: node linkType: hard +"strip-bom@npm:^3.0.0": + version: 3.0.0 + resolution: "strip-bom@npm:3.0.0" + checksum: 10/8d50ff27b7ebe5ecc78f1fe1e00fcdff7af014e73cf724b46fb81ef889eeb1015fc5184b64e81a2efe002180f3ba431bdd77e300da5c6685d702780fbf0c8d5b + languageName: node + linkType: hard + "strip-bom@npm:^4.0.0": version: 4.0.0 resolution: "strip-bom@npm:4.0.0" @@ -14650,6 +14660,17 @@ __metadata: languageName: node linkType: hard +"tsconfig-paths@npm:^4.2.0": + version: 4.2.0 + resolution: "tsconfig-paths@npm:4.2.0" + dependencies: + json5: "npm:^2.2.2" + minimist: "npm:^1.2.6" + strip-bom: "npm:^3.0.0" + checksum: 10/5e55cc2fb6b800eb72011522e10edefccb45b1f9af055681a51354c9b597d1390c6fa9cc356b8c7529f195ac8a90a78190d563159f3a1eed10e01bbd4d01a8ab + languageName: node + linkType: hard + "tslib@npm:2.6.2, tslib@npm:^2.0.0, tslib@npm:^2.2.0, tslib@npm:^2.3.1, tslib@npm:^2.6.2": version: 2.6.2 resolution: "tslib@npm:2.6.2"