Skip to content

Commit

Permalink
felt like working, might delete later
Browse files Browse the repository at this point in the history
  • Loading branch information
EmilIvanichkovv committed Jul 8, 2024
1 parent b284d3d commit d3a55b3
Show file tree
Hide file tree
Showing 14 changed files with 79 additions and 18 deletions.
3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
3 changes: 2 additions & 1 deletion beacon-light-client/circom/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
"extends": "../../tsconfig.hardhat.json",
"include": [
"./scripts/**/*.ts",
"./test/**/*.ts"
"./test/**/*.ts",
"**/*.json"
],
"files": [
"./hardhat.config.ts"
Expand Down
9 changes: 8 additions & 1 deletion beacon-light-client/plonky2/input_fetchers/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
{
"extends": "../../../tsconfig.json"
"extends": "../../../tsconfig.json",
"compilerOptions": {
"baseUrl": ".",
"paths": {
"@/*": ["./*"],
"@/abi": ["./balance_verification/abi/"],
}
},
}
7 changes: 7 additions & 0 deletions beacon-light-client/solidity/hardhat.config.ts
Original file line number Diff line number Diff line change
@@ -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';
Expand Down
1 change: 1 addition & 0 deletions beacon-light-client/solidity/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
11 changes: 9 additions & 2 deletions beacon-light-client/solidity/tsconfig.json
Original file line number Diff line number Diff line change
@@ -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",
],
}
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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
},
Expand Down
2 changes: 1 addition & 1 deletion relay/implementations/beacon-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
2 changes: 0 additions & 2 deletions relay/implementations/eos-contract.ts
Original file line number Diff line number Diff line change
@@ -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';

Expand Down
8 changes: 6 additions & 2 deletions relay/tsconfig.json
Original file line number Diff line number Diff line change
@@ -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"],
}
1 change: 1 addition & 0 deletions relay/utils/discord_monitor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
20 changes: 15 additions & 5 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -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. */
Expand All @@ -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. */
Expand All @@ -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. */
Expand Down Expand Up @@ -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"]

}
2 changes: 1 addition & 1 deletion yarn-project.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
23 changes: 22 additions & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand Down

0 comments on commit d3a55b3

Please sign in to comment.