Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
135 changes: 129 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"@radix-ui/react-tooltip": "^1.1.7",
"@reduxjs/toolkit": "^2.9.0",
"@tanstack/react-virtual": "^3.10.9",
"@typeberry/lib": "^0.5.0-6a64d40",
"@typeberry/lib": "^0.5.8",
"@typeberry/spectool-wasm": "0.23.0",
"@uiw/react-codemirror": "^4.25.1",
"baseline-browser-mapping": "^2.9.19",
Expand Down Expand Up @@ -68,6 +68,7 @@
"devDependencies": {
"@eslint/js": "^9.39.0",
"@playwright/test": "^1.57.0",
"@swc/core": "^1.13.5",
"@tailwindcss/postcss": "^4.1.18",
"@testing-library/dom": "^10.4.1",
"@testing-library/jest-dom": "^6.8.0",
Expand Down Expand Up @@ -95,8 +96,7 @@
"vite": "^7.3.1",
"vite-plugin-top-level-await": "^1.4.4",
"vite-plugin-wasm": "^3.5.0",
"vitest": "^4.0.14",
"@swc/core": "^1.13.5"
"vitest": "^4.0.14"
},
"lint-staged": {
"**/*.{ts,tsx}": [
Expand Down
2 changes: 1 addition & 1 deletion src/components/DebuggerSettings/Content.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import { Separator } from "../ui/separator";
import { WithHelp } from "../WithHelp/WithHelp";
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@/components/ui/select";
import { cn } from "@/lib/utils";
import { bytes } from "@typeberry/lib";
import * as bytes from "@typeberry/lib/bytes";
import { Button } from "@/components/ui/button";
import { SpiConfigDialog } from "./SpiConfigDialog";
import { TraceConfigDialog } from "./TraceConfigDialog";
Expand Down
2 changes: 1 addition & 1 deletion src/components/DebuggerSettings/SpiConfigDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { useState, useEffect } from "react";
import { EntrypointSelector, Entrypoint } from "../ProgramLoader/EntrypointSelector";
import { loadSpiConfig, saveSpiConfig } from "../ProgramLoader/spiConfig";
import { encodeRefineParams, encodeAccumulateParams, encodeIsAuthorizedParams } from "../ProgramLoader/spiEncoding";
import { bytes } from "@typeberry/lib";
import * as bytes from "@typeberry/lib/bytes";
import { Separator } from "../ui/separator";
import { useAppSelector } from "@/store/hooks";

Expand Down
9 changes: 4 additions & 5 deletions src/components/HostCallDialog/handlers/FetchHostCall.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
import { useEffect, useState } from "react";
import { Input } from "@/components/ui/input";
import { HostCallHandler, HostCallHandlerProps } from "./types";
import { jam_host_calls, pvm_host_calls, bytes, block } from "@typeberry/lib";
import * as jam_host_calls from "@typeberry/lib/jam-host-calls";
import * as pvm_host_calls from "@typeberry/lib/pvm-host-calls";
import * as bytes from "@typeberry/lib/bytes";
import * as block from "@typeberry/lib/block";
import { MockMemory, MockGasCounter, regsToBytes, bytesToRegs } from "./hostCallUtils";
import { HostCallActionButtons } from "./HostCallActionButtons";
import { DEFAULT_GAS, DEFAULT_REGS } from "@/types/pvm";
Expand Down Expand Up @@ -124,12 +127,8 @@ const FetchHostCallComponent: React.FC<HostCallHandlerProps> = ({
allWorkItems: () => (fetchKind === FetchKind.AllWorkItems ? dataBlob : null),
oneWorkItem: () => (fetchKind === FetchKind.OneWorkItem ? dataBlob : null),
workItemPayload: () => (fetchKind === FetchKind.WorkItemPayload ? dataBlob : null),
allOperands: () => null, // deprecated
allTransfersAndOperands: () => (fetchKind === FetchKind.AllTransfersAndOperands ? dataBlob : null),
oneOperand: () => null, // deprecated
oneTransferOrOperand: () => (fetchKind === FetchKind.OneTransferOrOperand ? dataBlob : null),
allTransfers: () => null, // deprecated
oneTransfer: () => null, // deprecated
};

// Create mock memory and registers
Expand Down
3 changes: 2 additions & 1 deletion src/components/HostCallDialog/handlers/GasHostCall.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { useState, useEffect, useMemo, useRef } from "react";
import { HostCallHandler, HostCallHandlerProps } from "./types";
import { jam_host_calls, block } from "@typeberry/lib";
import * as jam_host_calls from "@typeberry/lib/jam-host-calls";
import * as block from "@typeberry/lib/block";
import { HostCallContext } from "./hostCallUtils";
import { HostCallActionButtons } from "./HostCallActionButtons";
import { DEFAULT_REGS } from "@/types/pvm";
Expand Down
6 changes: 5 additions & 1 deletion src/components/HostCallDialog/handlers/InfoHostCall.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
import { useState, useEffect, useMemo } from "react";
import { Input } from "@/components/ui/input";
import { HostCallHandler, HostCallHandlerProps } from "./types";
import { jam_host_calls, block, state, bytes, numbers } from "@typeberry/lib";
import * as jam_host_calls from "@typeberry/lib/jam-host-calls";
import * as block from "@typeberry/lib/block";
import * as state from "@typeberry/lib/state";
import * as bytes from "@typeberry/lib/bytes";
import * as numbers from "@typeberry/lib/numbers";
import { HostCallContext } from "./hostCallUtils";
import { HostCallActionButtons } from "./HostCallActionButtons";
import { DEFAULT_REGS } from "@/types/pvm";
Expand Down
4 changes: 3 additions & 1 deletion src/components/HostCallDialog/handlers/ProvideHostCall.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import { useState, useEffect, useMemo, useRef } from "react";
import { HostCallHandler, HostCallHandlerProps } from "./types";
import { jam_host_calls, block, utils } from "@typeberry/lib";
import * as jam_host_calls from "@typeberry/lib/jam-host-calls";
import * as block from "@typeberry/lib/block";
import * as utils from "@typeberry/lib/utils";
import { HostCallContext, hexToAscii, OK } from "./hostCallUtils";
import { HostCallActionButtons } from "./HostCallActionButtons";
import { DEFAULT_REGS } from "@/types/pvm";
Expand Down
5 changes: 4 additions & 1 deletion src/components/HostCallDialog/handlers/ReadHostCall.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@ import { useState, useEffect, useMemo, useRef } from "react";
import { Input } from "@/components/ui/input";
import { Switch } from "@/components/ui/switch";
import { HostCallHandler, HostCallHandlerProps } from "./types";
import { jam_host_calls, bytes, block, numbers } from "@typeberry/lib";
import * as jam_host_calls from "@typeberry/lib/jam-host-calls";
import * as bytes from "@typeberry/lib/bytes";
import * as block from "@typeberry/lib/block";
import * as numbers from "@typeberry/lib/numbers";
import { HostCallContext, hexToAscii } from "./hostCallUtils";
import { storageManager } from "./storageManager";
import { HostCallActionButtons } from "./HostCallActionButtons";
Expand Down
5 changes: 4 additions & 1 deletion src/components/HostCallDialog/handlers/TransferHostCall.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import { useState, useEffect, useMemo, useRef } from "react";
import { HostCallHandler, HostCallHandlerProps } from "./types";
import { jam_host_calls, block, utils, bytes } from "@typeberry/lib";
import * as jam_host_calls from "@typeberry/lib/jam-host-calls";
import * as block from "@typeberry/lib/block";
import * as utils from "@typeberry/lib/utils";
import * as bytes from "@typeberry/lib/bytes";
import { HostCallContext, hexToAscii, OK } from "./hostCallUtils";
import { HostCallActionButtons } from "./HostCallActionButtons";
import { DEFAULT_REGS } from "@/types/pvm";
Expand Down
4 changes: 3 additions & 1 deletion src/components/HostCallDialog/handlers/WriteHostCall.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import { useState, useEffect, useMemo, useRef } from "react";
import { HostCallHandler, HostCallHandlerProps } from "./types";
import { jam_host_calls, block, utils } from "@typeberry/lib";
import * as jam_host_calls from "@typeberry/lib/jam-host-calls";
import * as block from "@typeberry/lib/block";
import * as utils from "@typeberry/lib/utils";
import { HostCallContext, hexToAscii, bytesToHex } from "./hostCallUtils";
import { storageManager } from "./storageManager";
import { HostCallActionButtons } from "./HostCallActionButtons";
Expand Down
5 changes: 4 additions & 1 deletion src/components/HostCallDialog/handlers/YieldHostCall.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import { useState, useEffect, useMemo, useRef } from "react";
import { HostCallHandler, HostCallHandlerProps } from "./types";
import { jam_host_calls, block, utils, hash } from "@typeberry/lib";
import * as jam_host_calls from "@typeberry/lib/jam-host-calls";
import * as block from "@typeberry/lib/block";
import * as utils from "@typeberry/lib/utils";
import * as hash from "@typeberry/lib/hash";
import { HostCallContext, OK } from "./hostCallUtils";
import { HostCallActionButtons } from "./HostCallActionButtons";
import { DEFAULT_REGS } from "@/types/pvm";
Expand Down
4 changes: 3 additions & 1 deletion src/components/HostCallDialog/handlers/hostCallUtils.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import { pvm, pvm_host_calls, utils } from "@typeberry/lib";
import * as pvm from "@typeberry/lib/pvm-interface";
import * as pvm_host_calls from "@typeberry/lib/pvm-host-calls";
import * as utils from "@typeberry/lib/utils";
import { DEFAULT_GAS, DEFAULT_REGS } from "@/types/pvm";

type IMemory = pvm.IMemory;
Expand Down
2 changes: 1 addition & 1 deletion src/components/HostCallDialog/handlers/storageManager.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { bytes } from "@typeberry/lib";
import * as bytes from "@typeberry/lib/bytes";

type BytesBlob = ReturnType<typeof bytes.BytesBlob.blobFrom>;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { NumeralSystem } from "@/context/NumeralSystem";
import workersReducer from "@/store/workers/workersSlice";
import debuggerReducer from "@/store/debugger/debuggerSlice";
import { TooltipProvider } from "@/components/ui/tooltip";
import { pvm_interpreter as pvm } from "@typeberry/lib";
import * as pvm from "@typeberry/lib/pvm-interpreter";

// Mock the utils module to avoid program decoding issues
vi.mock("../utils", async () => {
Expand Down
2 changes: 1 addition & 1 deletion src/components/Instructions/BasicBlocks/blockUtils.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { describe, it, expect } from "vitest";
import { pvm_interpreter as pvm } from "@typeberry/lib";
import * as pvm from "@typeberry/lib/pvm-interpreter";
import {
groupInstructionsByBlocks,
getVisibleInstructionCount,
Expand Down
2 changes: 1 addition & 1 deletion src/components/Instructions/utils.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { NumeralSystem } from "@/context/NumeralSystem.tsx";
import { pvm_interpreter as pvm } from "@typeberry/lib";
import * as pvm from "@typeberry/lib/pvm-interpreter";
import { ArgumentBitLengths, ArgsDecoder } from "@/packages/pvm/pvm/args-decoder";

export const valueToNumeralSystem = (
Expand Down
2 changes: 1 addition & 1 deletion src/components/MemoryPreview/utils.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { NumeralSystem } from "@/context/NumeralSystem";
import { WorkerState } from "@/store/workers/workersSlice";
import { valueToNumeralSystem } from "../Instructions/utils";
import { codec } from "@typeberry/lib";
import * as codec from "@typeberry/lib/codec";

export type FindMemoryForWorkerType = (
worker: WorkerState,
Expand Down
2 changes: 1 addition & 1 deletion src/components/ProgramLoader/Loader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { useNavigate } from "react-router";
import { Links } from "./Links";
import { Separator } from "../ui/separator";
import { TriangleAlert, FileText } from "lucide-react";
import { bytes } from "@typeberry/lib";
import * as bytes from "@typeberry/lib/bytes";
import {
EntrypointSelector,
Entrypoint,
Expand Down
3 changes: 2 additions & 1 deletion src/components/ProgramLoader/loading-utils.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { mapUploadFileInputToOutput } from "./utils";
import { bytes, pvm_interpreter as pvm } from "@typeberry/lib";
import * as bytes from "@typeberry/lib/bytes";
import * as pvm from "@typeberry/lib/pvm-interpreter";
import { DEFAULT_GAS, DEFAULT_REGS, ExpectedState, MemoryChunkItem, PageMapItem } from "@/types/pvm.ts";
import { type ZodSafeParseResult, z } from "zod";
import { bigUint64ArrayToRegistersArray, getAsChunks, getAsPageMap } from "@/lib/utils.ts";
Expand Down
4 changes: 3 additions & 1 deletion src/components/ProgramLoader/spiEncoding.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import { bytes, codec, numbers } from "@typeberry/lib";
import * as bytes from "@typeberry/lib/bytes";
import * as codec from "@typeberry/lib/codec";
import * as numbers from "@typeberry/lib/numbers";
import { RefineParams, AccumulateParams, IsAuthorizedParams } from "./EntrypointSelector";

export function encodeRefineParams(params: RefineParams): Uint8Array {
Expand Down
Loading
Loading