diff --git a/packages/client/bin/cli.ts b/packages/client/bin/cli.ts index 2a1e81f044..5e8648c257 100755 --- a/packages/client/bin/cli.ts +++ b/packages/client/bin/cli.ts @@ -658,7 +658,13 @@ async function startClient( validateConsensus = true } - const stateRoot = await generateVKTStateRoot(genesisMeta.genesisState, config.chainCommon) + let stateRoot + if (config.statefulVerkle) { + if (genesisMeta.genesisState === undefined) { + throw new Error('genesisState is required to compute stateRoot') + } + stateRoot = await generateVKTStateRoot(genesisMeta.genesisState, config.chainCommon) + } blockchain = await createBlockchain({ db: new LevelDB(dbs.chainDB), diff --git a/packages/client/src/util/vkt.ts b/packages/client/src/util/vkt.ts index dad6189436..85f4edf716 100644 --- a/packages/client/src/util/vkt.ts +++ b/packages/client/src/util/vkt.ts @@ -29,7 +29,6 @@ export async function generateVKTStateRoot(genesisState: GenesisState, common: C } const address = createAddressFromString(addressStr) await state.putAccount(address, new Account()) - console.log(addressStr, addrState) const codeBuf = hexToBytes((code as string) ?? '0x') if (common.customCrypto?.keccak256 === undefined) { throw Error('keccak256 required')