diff --git a/packages/engine/paima-funnel/src/utils.ts b/packages/engine/paima-funnel/src/utils.ts index d700f2b1c..7cf7b8976 100644 --- a/packages/engine/paima-funnel/src/utils.ts +++ b/packages/engine/paima-funnel/src/utils.ts @@ -1,5 +1,5 @@ import type { ChainData, ChainDataExtensionDatum, PresyncChainData } from '@paima/sm'; -import { ConfigNetworkType } from '@paima/utils'; +import type { ConfigNetworkType } from '@paima/utils'; export function groupCdeData( network: string, diff --git a/packages/engine/paima-runtime/src/runtime-loops.ts b/packages/engine/paima-runtime/src/runtime-loops.ts index fe3f99ff8..c4269a116 100644 --- a/packages/engine/paima-runtime/src/runtime-loops.ts +++ b/packages/engine/paima-runtime/src/runtime-loops.ts @@ -14,9 +14,8 @@ import { } from './utils.js'; import { cleanNoncesIfTime } from './nonce-gc.js'; import type { PoolClient } from 'pg'; -import { FUNNEL_PRESYNC_FINISHED } from '@paima/utils'; -import type { CardanoConfig } from '@paima/utils/src/config/loading.js'; -import { ConfigNetworkType } from '@paima/utils/src/config/loading.js'; +import { FUNNEL_PRESYNC_FINISHED, ConfigNetworkType } from '@paima/utils'; +import type { CardanoConfig } from '@paima/utils'; // The core logic of paima runtime which polls the funnel and processes the resulting chain data using the game's state machine. // Of note, the runtime is designed to continue running/attempting to process the next required block no matter what errors propagate upwards. @@ -81,11 +80,9 @@ async function runPresync( for (const network of Object.keys(networks)) { if (upper[network] > presyncBlockHeight[network]) { - doLog( - `${network}: ${JSON.stringify(presyncBlockHeight[network])}-${JSON.stringify(upper[network])}` - ); + doLog(`[presync-round] ${network}: ${presyncBlockHeight[network]}-${upper[network]}`); } else { - doLog(`${network}: ${JSON.stringify(presyncBlockHeight[network])}`); + doLog(`[presync-round] ${network}: ${presyncBlockHeight[network]}`); } } diff --git a/packages/engine/paima-sm/src/index.ts b/packages/engine/paima-sm/src/index.ts index 126813efc..7c89d7073 100644 --- a/packages/engine/paima-sm/src/index.ts +++ b/packages/engine/paima-sm/src/index.ts @@ -119,7 +119,9 @@ const SM: GameStateMachineInitializer = { dbTx ); if (cdeDataLength > 0) { - doLog(`Processed ${cdeDataLength} CDE events in block #${latestCdeData.blockNumber}`); + doLog( + `[${latestCdeData.network}] Processed ${cdeDataLength} CDE events in block #${latestCdeData.blockNumber}` + ); } } else if (latestCdeData.networkType === ConfigNetworkType.CARDANO) { const cdeDataLength = await processCardanoCdeData( @@ -128,7 +130,9 @@ const SM: GameStateMachineInitializer = { dbTx ); if (cdeDataLength > 0) { - doLog(`Processed ${cdeDataLength} CDE events in slot #${latestCdeData.blockNumber}`); + doLog( + `[${latestCdeData.network}] Processed ${cdeDataLength} CDE events in slot #${latestCdeData.blockNumber}` + ); } } }, diff --git a/packages/paima-sdk/paima-utils/src/config/loading.ts b/packages/paima-sdk/paima-utils/src/config/loading.ts index e0b1fcc7b..e231a6661 100644 --- a/packages/paima-sdk/paima-utils/src/config/loading.ts +++ b/packages/paima-sdk/paima-utils/src/config/loading.ts @@ -1,7 +1,6 @@ import * as fs from 'fs/promises'; import YAML from 'yaml'; import type { Static, TSchema } from '@sinclair/typebox'; -import type { ValueErrorType } from '@sinclair/typebox/value'; import { Value } from '@sinclair/typebox/value'; import { Type } from '@sinclair/typebox'; import { ENV, doLog } from '../index.js'; @@ -124,7 +123,6 @@ export function parseConfigFile(configFileData: string): Static( name: undefined | string, structure: T, @@ -132,11 +130,9 @@ function checkOrError( ): Static { // 1) Check if there are any errors since Value.Decode doesn't give error messages { - const skippableErrors: ValueErrorType[] = []; - const errors = Array.from(Value.Errors(structure, config)); for (const error of errors) { - if (errors.length !== 1 && skippableErrors.find(val => val === error.type) != null) continue; + if (errors.length !== 1) continue; console.error({ name: name ?? 'Configuration root', path: error.path,