Skip to content

Commit

Permalink
Update packages
Browse files Browse the repository at this point in the history
  • Loading branch information
mhanson-github committed Jan 5, 2025
1 parent 72095b7 commit b119ddc
Show file tree
Hide file tree
Showing 117 changed files with 858 additions and 591 deletions.
1,011 changes: 639 additions & 372 deletions package-lock.json

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "@shardus/core",
"name": "@shardeum-foundation/core",
"version": "2.13.4-0",
"engines": {
"node": "18.19.1"
Expand Down Expand Up @@ -54,11 +54,11 @@
"access": "public"
},
"dependencies": {
"@shardeum-foundation/lib-crypto-utils": "4.1.5",
"@shardeum-foundation/lib-net": "1.4.0",
"@shardeum-foundation/lib-types": "1.2.21",
"@hapi/sntp": "3.1.1",
"@mapbox/node-pre-gyp": "1.0.10",
"@shardus/crypto-utils": "git+https://github.com/shardeum/lib-crypto-utils#dev",
"@shardus/net": "git+https://github.com/shardeum/lib-net#dev",
"@shardus/types": "git+https://github.com/shardeum/lib-types#dev",
"@types/better-sqlite3": "7.6.3",
"body-parser": "1.18.3",
"bytenode": "1.3.4",
Expand Down
2 changes: 1 addition & 1 deletion src/crypto/computePowGenerator.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as crypto from '@shardus/crypto-utils'
import * as crypto from '@shardeum-foundation/lib-crypto-utils'
crypto.init('69fa4195670576c0160d660c3be36556ff8d504725be8a59b5a96509e0c994bc')

function hex2bin(hex) {
Expand Down
4 changes: 2 additions & 2 deletions src/crypto/index.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import * as crypto from '@shardus/crypto-utils'
import * as crypto from '@shardeum-foundation/lib-crypto-utils'
import { ChildProcess, fork, Serializable } from 'child_process'
import fs from 'fs'
import Log4js from 'log4js'
import path from 'path'
import Logger, { logFlags } from '../logger'
import * as Shardus from '../shardus/shardus-types'
import Storage from '../storage'
import { Utils } from '@shardus/types'
import { Utils } from '@shardeum-foundation/lib-types'

export type HashableObject = (object | string) & { sign?: Shardus.Sign }

Expand Down
2 changes: 1 addition & 1 deletion src/debug/debug.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { nestedCountersInstance } from '../utils/nestedCounters'
import { logFlags } from '../logger'
import { currentCycle } from '../p2p/CycleCreator'
import * as ProblemNodeHandler from '../p2p/ProblemNodeHandler'
import { Node } from '@shardus/types/build/src/p2p/NodeListTypes'
import { Node } from '@shardeum-foundation/lib-types/build/src/p2p/NodeListTypes'
import { nodes } from '../p2p/NodeList'
const tar = require('tar-fs')
const fs = require('fs')
Expand Down
2 changes: 1 addition & 1 deletion src/http/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { parse as parseUrl } from 'url'
import got from 'got'
import { logFlags } from '../logger'
import { Utils } from '@shardus/types'
import { Utils } from '@shardeum-foundation/lib-types'
import { stringifyReduceLimit } from '../utils'

let _logger = null
Expand Down
2 changes: 1 addition & 1 deletion src/load-detection/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { profilerInstance, NodeLoad } from '../utils/profiler'
import * as Context from '../p2p/Context'
import { memoryReportingInstance } from '../utils/memoryReporting'
import { isDebugModeMiddleware } from '../network/debugMiddleware'
import { Utils } from '@shardus/types'
import { Utils } from '@shardeum-foundation/lib-types'

interface LoadDetection {
highThreshold: number /** if load > highThreshold, then scale up request */
Expand Down
2 changes: 1 addition & 1 deletion src/logger/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import * as http from '../http'
import * as Shardus from '../shardus/shardus-types'
import { profilerInstance } from '../utils/profiler'
import { nestedCountersInstance } from '../utils/nestedCounters'
import { Utils } from '@shardus/types'
import { Utils } from '@shardeum-foundation/lib-types'
const log4jsExtend = require('log4js-extend')
import got from 'got'
import { parse as parseUrl } from 'url'
Expand Down
8 changes: 4 additions & 4 deletions src/network/debugMiddleware.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import { isDebugMode, getDevPublicKeys, ensureKeySecurity, getMultisigPublicKeys } from '../debug'
import * as Context from '../p2p/Context'
import * as crypto from '@shardus/crypto-utils'
import * as crypto from '@shardeum-foundation/lib-crypto-utils'
import { DevSecurityLevel } from '../shardus/shardus-types'
import SERVER_CONFIG from '../config/server'
import { logFlags } from '../logger'
import { nestedCountersInstance } from '../utils/nestedCounters'
import { Utils } from '@shardus/types'
import { SignedObject } from '@shardus/crypto-utils'
import { Utils } from '@shardeum-foundation/lib-types'
import { SignedObject } from '@shardeum-foundation/lib-crypto-utils'
import * as CycleChain from '../p2p/CycleChain'
import { contactArchiver, getStatusHistoryCopy } from '../p2p/Self'
import { NodeStatus } from '@shardus/types/build/src/p2p/P2PTypes'
import { NodeStatus } from '@shardeum-foundation/lib-types/build/src/p2p/P2PTypes'
import { getNewestCycle } from '../p2p/Sync'

const MAX_COUNTER_BUFFER_MILLISECONDS = 10000 // <- Nonce are essentially just timestamp. This number dictate how much time range we will tolerance.
Expand Down
6 changes: 3 additions & 3 deletions src/network/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Sntp from '@hapi/sntp'
import { Sn } from '@shardus/net'
import { AppHeader } from '@shardus/net/build/src/types'
import { Sn } from '@shardeum-foundation/lib-net'
import { AppHeader } from '@shardeum-foundation/lib-net/build/src/types'
import bodyParser from 'body-parser'
import cors from 'cors'
import { EventEmitter } from 'events'
Expand All @@ -19,7 +19,7 @@ import { formatErrorMessage } from '../utils'
import { nestedCountersInstance } from '../utils/nestedCounters'
import { profilerInstance } from '../utils/profiler'
import NatAPI = require('nat-api')
import { Utils } from '@shardus/types'
import { Utils } from '@shardeum-foundation/lib-types'

/** TYPES */
export interface IPInfo {
Expand Down
6 changes: 3 additions & 3 deletions src/p2p/Active.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Logger } from 'log4js'
import { logFlags } from '../logger'
import { P2P } from '@shardus/types'
import { P2P } from '@shardeum-foundation/lib-types'
import * as utils from '../utils'
import { validateTypes } from '../utils'
import * as Comms from './Comms'
Expand All @@ -10,12 +10,12 @@ import * as CycleChain from './CycleChain'
import * as NodeList from './NodeList'
import * as Self from './Self'
import { profilerInstance } from '../utils/profiler'
import { NodeStatus } from '@shardus/types/build/src/p2p/P2PTypes'
import { NodeStatus } from '@shardeum-foundation/lib-types/build/src/p2p/P2PTypes'
import { nestedCountersInstance } from '../utils/nestedCounters'
import { getSortedStandbyJoinRequests } from './Join/v2'
import { selectNodesFromReadyList } from './Join/v2/syncFinished'
import { isDebugModeMiddleware } from '../network/debugMiddleware'
import { Utils } from '@shardus/types'
import { Utils } from '@shardeum-foundation/lib-types'
import { nodeListFromStates } from "./Join";
import { checkGossipPayload } from '../utils/GossipValidation'

Expand Down
4 changes: 2 additions & 2 deletions src/p2p/Apoptosis.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ it is saved and gossiped to other nodes.
When the apoptosized field of a cycle record contains the node id
of a particular node, the node is removed from the node list.
*/
import { P2P } from '@shardus/types'
import { P2P } from '@shardeum-foundation/lib-types'
import { Handler } from 'express'
import { isDebugMode } from '../debug'
import { logFlags } from '../logger'
Expand Down Expand Up @@ -47,7 +47,7 @@ import { robustQuery } from './Utils'
import { TypeIdentifierEnum } from '../types/enum/TypeIdentifierEnum'
import { SQLDataTypes } from '../storage/utils/schemaDefintions'
import { InternalRouteEnum } from '../types/enum/InternalRouteEnum'
import { Utils } from '@shardus/types'
import { Utils } from '@shardeum-foundation/lib-types'
import { BadRequest, serializeResponseError } from '../types/ResponseError'
import { RequestErrorEnum } from '../types/enum/RequestErrorEnum'
import { getStreamWithTypeCheck, requestErrorHandler } from '../types/Helpers'
Expand Down
12 changes: 6 additions & 6 deletions src/p2p/Archivers.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { hexstring, P2P, publicKey, StateManager } from '@shardus/types'
import { hexstring, P2P, publicKey, StateManager } from '@shardeum-foundation/lib-types'
import deepmerge from 'deepmerge'
import * as http from '../http'
import { logFlags } from '../logger'
Expand All @@ -23,16 +23,16 @@ import * as NodeList from './NodeList'
import Timeout = NodeJS.Timeout
import { apoptosizeSelf } from './Apoptosis'
import { randomInt } from 'crypto'
import { CycleRecord } from '@shardus/types/build/src/p2p/CycleCreatorTypes'
import { StateMetaData } from '@shardus/types/build/src/p2p/SnapshotTypes'
import { DataRequest, JoinedArchiver } from '@shardus/types/build/src/p2p/ArchiversTypes'
import { CycleRecord } from '@shardeum-foundation/lib-types/build/src/p2p/CycleCreatorTypes'
import { StateMetaData } from '@shardeum-foundation/lib-types/build/src/p2p/SnapshotTypes'
import { DataRequest, JoinedArchiver } from '@shardeum-foundation/lib-types/build/src/p2p/ArchiversTypes'
import * as CycleChain from './CycleChain'
import rfdc from 'rfdc'
import { shardusGetTime } from '../network'
import { reportLostArchiver } from '../p2p/LostArchivers/functions'
import { ActiveNode } from '@shardus/types/build/src/p2p/SyncTypes'
import { ActiveNode } from '@shardeum-foundation/lib-types/build/src/p2p/SyncTypes'
import { Result, ResultAsync } from 'neverthrow'
import { Utils } from '@shardus/types'
import { Utils } from '@shardeum-foundation/lib-types'
import { arch } from 'os'
import { checkGossipPayload } from '../utils/GossipValidation'

Expand Down
6 changes: 3 additions & 3 deletions src/p2p/Comms.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { AppHeader } from '@shardus/net/build/src/types'
import { P2P } from '@shardus/types'
import { AppHeader } from '@shardeum-foundation/lib-net/build/src/types'
import { P2P } from '@shardeum-foundation/lib-types'
import { Logger } from 'log4js'
import { logFlags } from '../logger'
import { ipInfo, shardusGetTime } from '../network'
Expand All @@ -25,7 +25,7 @@ import { RequestErrorEnum } from '../types/enum/RequestErrorEnum'
import { getStreamWithTypeCheck, requestErrorHandler } from '../types/Helpers'
import { TypeIdentifierEnum } from '../types/enum/TypeIdentifierEnum'
import { InternalError, ResponseError, serializeResponseError } from '../types/ResponseError'
import { Utils } from '@shardus/types'
import { Utils } from '@shardeum-foundation/lib-types'
import { nodeListFromStates } from './Join'

/** ROUTES */
Expand Down
4 changes: 2 additions & 2 deletions src/p2p/CycleAutoScale.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import deepmerge from 'deepmerge'
import { Logger } from 'log4js'
import { logFlags } from '../logger'
import { P2P } from '@shardus/types'
import { P2P } from '@shardeum-foundation/lib-types'
import { sleep, validateTypes, fastIsPicked } from '../utils'
import * as Comms from './Comms'
import { config, crypto, logger, stateManager } from './Context'
Expand All @@ -14,7 +14,7 @@ import { nestedCountersInstance } from '../utils/nestedCounters'
import { enterRecovery, enterSafety } from './Modes'
import { getOurNodeIndex } from './Utils'
import { shardusGetTime } from '../network'
import { Utils } from '@shardus/types'
import { Utils } from '@shardeum-foundation/lib-types'

/** STATE */

Expand Down
2 changes: 1 addition & 1 deletion src/p2p/CycleChain.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Logger } from 'log4js'
import { crypto, logger, stateManager } from './Context'
import { hexstring, P2P } from '@shardus/types'
import { hexstring, P2P } from '@shardeum-foundation/lib-types'
import { nodes } from './NodeList'
import { nestedCountersInstance } from '../utils/nestedCounters'
import { logFlags } from '../logger'
Expand Down
6 changes: 3 additions & 3 deletions src/p2p/CycleCreator.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import deepmerge from 'deepmerge'
import { Logger } from 'log4js'
import { logFlags } from '../logger'
import { P2P } from '@shardus/types'
import { P2P } from '@shardeum-foundation/lib-types'
import * as utils from '../utils'
// don't forget to add new modules here
import * as Active from './Active'
Expand All @@ -25,7 +25,7 @@ import * as LostArchivers from './LostArchivers'
import { compareQuery, Comparison } from './Utils'
import { errorToStringFull, formatErrorMessage } from '../utils'
import { nestedCountersInstance } from '../utils/nestedCounters'
import { randomBytes } from '@shardus/crypto-utils'
import { randomBytes } from '@shardeum-foundation/lib-crypto-utils'
import { digestCycle, syncNewCycles } from './Sync'
import { shardusGetTime } from '../network'
import { InternalBinaryHandler } from '../types/Handler'
Expand All @@ -47,7 +47,7 @@ import path from 'path'
import { getStreamWithTypeCheck, requestErrorHandler } from '../types/Helpers'
import { RequestErrorEnum } from '../types/enum/RequestErrorEnum'
import { BadRequest, InternalError, NotFound, serializeResponseError } from '../types/ResponseError'
import { Utils } from '@shardus/types'
import { Utils } from '@shardeum-foundation/lib-types'
import { nodeListFromStates } from './Join'
import { AJVSchemaEnum } from '../types/enum/AJVSchemaEnum'

Expand Down
2 changes: 1 addition & 1 deletion src/p2p/CycleParser.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import deepmerge from 'deepmerge'
import { P2P } from '@shardus/types'
import { P2P } from '@shardeum-foundation/lib-types'
import { reversed } from '../utils'
import * as CycleCreator from './CycleCreator'

Expand Down
4 changes: 2 additions & 2 deletions src/p2p/GlobalAccounts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*/

import { logFlags } from '../logger'
import { P2P } from '@shardus/types'
import { P2P } from '@shardeum-foundation/lib-types'
import ShardFunctions from '../state-manager/shardFunctions'
import * as utils from '../utils'
import * as Comms from './Comms'
Expand All @@ -22,7 +22,7 @@ import { RequestErrorEnum } from '../types/enum/RequestErrorEnum'
import { getStreamWithTypeCheck, requestErrorHandler } from '../types/Helpers'
import { TypeIdentifierEnum } from '../types/enum/TypeIdentifierEnum'
import { MakeReceiptReq, deserializeMakeReceiptReq, serializeMakeReceiptReq } from '../types/MakeReceipReq'
import { Utils } from '@shardus/types'
import { Utils } from '@shardeum-foundation/lib-types'

/** ROUTES */
// [TODO] - need to add validattion of types to the routes
Expand Down
6 changes: 3 additions & 3 deletions src/p2p/Join/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import deepmerge from 'deepmerge'
import { version } from '../../../package.json'
import * as http from '../../http'
import { logFlags } from '../../logger'
import { hexstring, P2P } from '@shardus/types'
import { hexstring, P2P } from '@shardeum-foundation/lib-types'
import * as utils from '../../utils'
import { validateTypes, isEqualOrNewerVersion } from '../../utils'
import * as Comms from '../Comms'
Expand All @@ -28,7 +28,7 @@ import {
import { err, ok, Result } from 'neverthrow'
import { drainSelectedPublicKeys, forceSelectSelf } from './v2/select'
import { deleteStandbyNode, drainNewUnjoinRequests, processNewUnjoinRequest } from './v2/unjoin'
import { JoinRequest } from '@shardus/types/build/src/p2p/JoinTypes'
import { JoinRequest } from '@shardeum-foundation/lib-types/build/src/p2p/JoinTypes'
import { updateNodeState } from '../Self'

Check warning on line 32 in src/p2p/Join/index.ts

View workflow job for this annotation

GitHub Actions / ci / QA merge checks

'updateNodeState' is defined but never used
import { HTTPError } from 'got'

Check warning on line 33 in src/p2p/Join/index.ts

View workflow job for this annotation

GitHub Actions / ci / QA merge checks

'HTTPError' is defined but never used
import {
Expand All @@ -41,7 +41,7 @@ import { addFinishedSyncing, drainFinishedSyncingRequest, newSyncFinishedNodes }
//import { getLastCycleStandbyRefreshRequest, resetLastCycleStandbyRefreshRequests, drainNewStandbyRefreshRequests } from './v2/standbyRefresh'
import { drainNewStandbyRefreshRequests, addStandbyRefresh } from './v2/standbyRefresh'
import rfdc from 'rfdc'
import { Utils } from '@shardus/types'
import { Utils } from '@shardeum-foundation/lib-types'
import { neverGoActive } from '../Active'

/** STATE */
Expand Down
6 changes: 3 additions & 3 deletions src/p2p/Join/routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import * as NodeList from '../NodeList'
import * as Self from '../Self'
import * as utils from '../../utils'
import { Handler } from 'express'
import { P2P } from '@shardus/types'
import { P2P } from '@shardeum-foundation/lib-types'
import {
addJoinRequest,
computeSelectionNum,
Expand Down Expand Up @@ -38,10 +38,10 @@ import {
JoinRequest,
SignedUnjoinRequest,
StartedSyncingRequest,
} from '@shardus/types/build/src/p2p/JoinTypes'
} from '@shardeum-foundation/lib-types/build/src/p2p/JoinTypes'
import { addSyncStarted } from './v2/syncStarted'
import { addStandbyRefresh } from './v2/standbyRefresh'
import { Utils } from '@shardus/types'
import { Utils } from '@shardeum-foundation/lib-types'
import { testFailChance } from '../../utils'
import { shardusGetTime } from '../../network'
import { verifyPayload } from '../../types/ajv/Helpers'
Expand Down
6 changes: 3 additions & 3 deletions src/p2p/Join/v2/acceptance.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { hexstring, P2P } from "@shardus/types";
import { hexstring, P2P } from "@shardeum-foundation/lib-types";
import { JoinedConsensor } from "@shardeum-foundation/lib-types/build/src/p2p/JoinTypes";
import { SignedObject } from "@shardeum-foundation/lib-types/build/src/p2p/P2PTypes";
import { err, ok } from "neverthrow";
import { EventEmitter } from "events";
import { Result } from "neverthrow";
import * as http from '../../../http'
import { getRandom } from "../../../utils";
import { crypto } from "../../Context";
import { JoinedConsensor } from "@shardus/types/build/src/p2p/JoinTypes";
import { SignedObject } from "@shardus/types/build/src/p2p/P2PTypes";
import { getActiveNodesFromArchiver, getRandomAvailableArchiver } from "../../Utils";
import * as Self from "../../Self";

Expand Down
6 changes: 3 additions & 3 deletions src/p2p/Join/v2/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
* TODO: Rename this module later?
*/

import { P2P, hexstring } from '@shardus/types'
import { JoinRequest } from '@shardus/types/build/src/p2p/JoinTypes'
import { P2P, hexstring } from '@shardeum-foundation/lib-types'
import { JoinRequest } from '@shardeum-foundation/lib-types/build/src/p2p/JoinTypes'
import { config, crypto, shardus } from '../../Context'
import * as CycleChain from '../../CycleChain'
import * as Self from '../../Self'
Expand All @@ -16,7 +16,7 @@ import { ResultAsync } from 'neverthrow'
import { reset as resetAcceptance } from './acceptance'
import { stringifyReduce } from '../../../utils/functions/stringifyReduce'
import { logFlags } from '../../../logger'
import { Utils } from '@shardus/types'
import { Utils } from '@shardeum-foundation/lib-types'

const clone = rfdc()

Expand Down
4 changes: 2 additions & 2 deletions src/p2p/Join/v2/standbyRefresh.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ import * as utils from '../../../utils'
import * as http from '../../../http'
import { ok, Result } from 'neverthrow'
import { logFlags } from '../../../logger'
import { JoinRequest, StandbyRefreshRequest } from '@shardus/types/build/src/p2p/JoinTypes'
import { JoinRequest, StandbyRefreshRequest } from '@shardeum-foundation/lib-types/build/src/p2p/JoinTypes'
import { isOnStandbyList } from './index'
import * as CycleChain from '../../CycleChain'
import { crypto } from '../../Context'
import { SignedObject } from '@shardus/types/build/src/p2p/P2PTypes'
import { SignedObject } from '@shardeum-foundation/lib-types/build/src/p2p/P2PTypes'
import { config } from '../../Context'

type publickey = JoinRequest['nodeInfo']['publicKey']
Expand Down
6 changes: 3 additions & 3 deletions src/p2p/Join/v2/syncFinished.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import * as NodeList from '../../NodeList'
import { FinishedSyncingRequest, JoinRequest } from '@shardus/types/build/src/p2p/JoinTypes'
import { SignedObject } from '@shardus/crypto-utils'
import { FinishedSyncingRequest, JoinRequest } from '@shardeum-foundation/lib-types/build/src/p2p/JoinTypes'
import { SignedObject } from '@shardeum-foundation/lib-crypto-utils'
import * as CycleChain from '../../CycleChain'
import { crypto } from '../../Context'
import { nestedCountersInstance } from '../../../utils/nestedCounters'
import { config } from '../../Context'
import { P2P } from '@shardus/types'
import { P2P } from '@shardeum-foundation/lib-types'
import { logFlags } from '../../../logger'
import { isFirst } from '../../Self'

Expand Down
Loading

0 comments on commit b119ddc

Please sign in to comment.