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
5 changes: 5 additions & 0 deletions .changeset/api-alpha13.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@deroll/decoder": minor
---

follow the rollups-node 2.0.0-alpha.13 JSON-RPC API: bump `@cartesi/client` to 2.0.0-alpha.38 and `@cartesi/codec` to 1.0.0-alpha.5 (new contract/portal addresses). The re-exported `Input` record replaces `outputsHash` with `txBufferDataBlock`, adds `exceptionData`, and its status drops the resource-limit values for OVERFLOW/UNEXPECTED_YIELD/INVALID_OUTPUTS_ROOT
8 changes: 8 additions & 0 deletions .changeset/bump-deps-oct.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
"@deroll/create-app": patch
"@deroll/decoder": patch
"@deroll/genext2fs": patch
"@deroll/wallet": patch
---

bump dependencies: `@cartesi/rollup` 1.0.0-alpha.3, `@cartesi/codec` 1.0.0-alpha.5 and viem 2.57. The wallet now recognizes deposits from the portal addresses of the new rollups contracts (through `@cartesi/codec`'s `decodeDeposit`). Applications scaffolded by `@deroll/create-app` build on Node.js 24.20.0
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0

- name: Setup Node.js
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version: 24

Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
genext2fs-publish: ${{ steps.check-genext2fs.outputs.publish }}
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version: 24
- id: check-genext2fs
Expand Down Expand Up @@ -62,14 +62,14 @@ jobs:
# deps/genext2fs and deps/libarchive are compiled into the addon
submodules: recursive
- uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version: 24
- run: bun install --frozen-lockfile
- name: Build prebuild
working-directory: packages/bindings/genext2fs
run: bun run prebuild:native
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
- uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: genext2fs-prebuilds-${{ matrix.os }}
if-no-files-found: error
Expand Down Expand Up @@ -99,7 +99,7 @@ jobs:
uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0

- name: Setup Node.js
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version: 24
registry-url: https://registry.npmjs.org
Expand All @@ -119,15 +119,15 @@ jobs:
# have to compile the addon.
- name: Collect genext2fs prebuilds
if: needs.detect.outputs.genext2fs-publish == 'true'
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
with:
pattern: genext2fs-prebuilds-*
merge-multiple: true
path: packages/bindings/genext2fs/prebuilds

- name: Create Release Pull Request or Publish to npm
id: changesets
uses: changesets/action@22ccf9aa43179fe9e27dc62e575971d28cce197c # v2.0.0
uses: changesets/action@ae32849d5ba541f9ae29e40e22a623bc13562f51 # v2.1.2
with:
# `release` builds the packages, resolves workspace:/catalog:
# protocols to concrete versions (npm publish, which changeset
Expand Down
26 changes: 13 additions & 13 deletions apps/docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,25 +10,25 @@
"preview": "vocs preview"
},
"dependencies": {
"@cartesi/codec": "1.0.0-alpha.1",
"@cartesi/rollup": "1.0.0-alpha.1",
"@cartesi/codec": "1.0.0-alpha.5",
"@cartesi/rollup": "1.0.0-alpha.3",
"@deroll/genext2fs": "workspace:*",
"@deroll/wallet": "workspace:*",
"@types/react": "^19",
"path-to-regexp": "^8.4.2",
"react": "^19",
"react-dom": "^19",
"viem": "^2.56.3",
"vocs": "^2.8.5",
"waku": "1.0.0-beta.8"
"react": "^19.3.0",
"react-dom": "^19.3.0",
"viem": "^2.57.5",
"vocs": "^2.10.2",
"waku": "1.0.0-rc.3"
},
"devDependencies": {
"@types/node": "^26",
"@types/react": "^19",
"@types/react-dom": "^19",
"@vitejs/plugin-react": "^6",
"typescript": "^6",
"vite": "^8"
"@types/node": "^26.6.5",
"@types/react": "^19.3.0",
"@types/react-dom": "^19.3.0",
"@vitejs/plugin-react": "^6.1.2",
"typescript": "^6.0.3",
"vite": "^8.3.4"
},
"engines": {
"node": "24.x"
Expand Down
10 changes: 5 additions & 5 deletions apps/examples/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,17 +30,17 @@
"dist/**"
],
"dependencies": {
"@cartesi/rollup": "1.0.0-alpha.1",
"@cartesi/rollup": "1.0.0-alpha.3",
"@deroll/wallet": "workspace:*",
"viem": "^2.56.3"
"viem": "^2.57.5"
},
"devDependencies": {
"@biomejs/biome": "catalog:",
"@deroll/tsconfig": "workspace:*",
"@types/node": "^26",
"@types/node": "^26.6.5",
"tsup": "^8.5.1",
"tsx": "^4.23.13",
"tsx": "^4.23.15",
"typescript": "^6.0.3",
"vitest": "^5.0.0"
"vitest": "^5.0.4"
}
}
2 changes: 1 addition & 1 deletion apps/explorer/biome.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "https://biomejs.dev/schemas/2.5.12/schema.json",
"$schema": "https://biomejs.dev/schemas/2.5.15/schema.json",
"root": false,
"extends": "//",
"css": {
Expand Down
32 changes: 16 additions & 16 deletions apps/explorer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,25 +10,25 @@
"lint": "biome check"
},
"dependencies": {
"@cartesi/client": "2.0.0-alpha.34",
"@cartesi/codec": "1.0.0-alpha.0",
"@cartesi/react": "2.0.0-alpha.38",
"@cartesi/client": "2.0.0-alpha.38",
"@cartesi/codec": "1.0.0-alpha.5",
"@cartesi/react": "2.0.0-alpha.42",
"@deroll/decoder": "workspace:*",
"@tanstack/react-query": "^5.102.8",
"react": "^19",
"react-dom": "^19",
"react-router-dom": "^7.18.3",
"viem": "^2.56.3",
"@tanstack/react-query": "^5.104.2",
"react": "^19.3.0",
"react-dom": "^19.3.0",
"react-router-dom": "^7.18.4",
"viem": "^2.57.5",
"wagmi": "^3.7.7"
},
"devDependencies": {
"@tailwindcss/vite": "^4.3.2",
"@types/node": "^26",
"@types/react": "^19",
"@types/react-dom": "^19",
"@vitejs/plugin-react": "^6",
"tailwindcss": "^4.3.2",
"typescript": "^6.0.3",
"vite": "^8"
"@tailwindcss/vite": "^4.3.3",
"@types/node": "^26.6.5",
"@types/react": "^19.3.0",
"@types/react-dom": "^19.3.0",
"@vitejs/plugin-react": "^6.1.2",
"tailwindcss": "^4.3.3",
"typescript": "^7.0.2",
"vite": "^8.3.4"
}
}
4 changes: 2 additions & 2 deletions apps/explorer/src/api/errors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import { BaseError, HttpRequestError, RpcRequestError } from "viem";

/**
* True when the failure is a JSON-RPC error RESPONSE — proof the server is
* answering (e.g. a node without an EVM reader errors on cartesi_getChainId
* while serving everything else). Transport failures (network/CORS, non-200)
* answering (e.g. a node that does not implement cartesi_getNodeInfo while
* serving everything else). Transport failures (network/CORS, non-200)
* are not.
*/
export function isRpcResponseError(error: unknown): boolean {
Expand Down
28 changes: 15 additions & 13 deletions apps/explorer/src/components/Layout.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { useEffect, useState } from "react";
import { Link, Outlet } from "react-router-dom";
import { isRpcResponseError } from "../api/errors";
import { useChainId, useNodeVersion } from "@cartesi/react";
import { useNodeInfo } from "@cartesi/react";
import { useServer } from "../server";
import { useTheme } from "../theme";

Expand All @@ -10,17 +10,12 @@ function ServerBar() {
const [draft, setDraft] = useState(server);
useEffect(() => setDraft(server), [server]);

const chainId = useChainId({});
const version = useNodeVersion({});
const info = useNodeInfo({});
// An RPC-level error still proves the server is answering — e.g. a node
// running without an EVM reader errors on cartesi_getChainId while serving
// everything else.
const connected =
chainId.isSuccess ||
version.isSuccess ||
isRpcResponseError(chainId.error) ||
isRpcResponseError(version.error);
const checking = (chainId.isLoading || version.isLoading) && !connected;
// that does not implement cartesi_getNodeInfo while serving everything
// else.
const connected = info.isSuccess || isRpcResponseError(info.error);
const checking = info.isLoading && !connected;

return (
<form
Expand Down Expand Up @@ -49,8 +44,15 @@ function ServerBar() {
/>
{connected ? (
<span className="hidden sm:inline whitespace-nowrap">
{chainId.isSuccess && <>chain {chainId.data} · </>}
node v{version.data ?? "?"}
{info.isSuccess ? (
<span title="Block tag up to which the node reads chain state">
chain {info.data.chainId} · node v
{info.data.version} ·{" "}
{info.data.defaultBlock.toLowerCase()}
</span>
) : (
"node v?"
)}
</span>
) : (
<span className="hidden sm:inline">
Expand Down
4 changes: 2 additions & 2 deletions apps/explorer/src/components/TxHash.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { useChainId } from "@cartesi/react";
import { useNodeInfo } from "@cartesi/react";
import { explorerFor, txExplorerUrl } from "../lib/explorer";
import { Hex } from "./ui";

Expand All @@ -15,7 +15,7 @@ export function TxHash({
value?: string | null;
full?: boolean;
}) {
const chainId = useChainId({}).data;
const chainId = useNodeInfo({}).data?.chainId;
const explorer = explorerFor(chainId);
return (
<Hex
Expand Down
50 changes: 41 additions & 9 deletions apps/explorer/src/components/ui.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,8 @@ const STATUS_COLORS: Record<string, string> = {
FAILED: RED,
DIVERGED: RED,
CORRUPTED: RED,
GUEST_EXCEPTION: RED,
MCYCLE_OVERFLOW: RED,
ENABLED: GREEN,
DISABLED: GRAY,
// epoch
Expand All @@ -134,27 +136,57 @@ const STATUS_COLORS: Record<string, string> = {
CLAIM_ACCEPTED: GREEN,
CLAIM_REJECTED: RED,
CLAIM_FORECLOSED: GRAY,
// input
// input (MACHINE_HALTED, UNEXPECTED_YIELD and INVALID_OUTPUTS_ROOT are
// also application statuses)
NONE: GRAY,
ACCEPTED: GREEN,
REJECTED: RED,
EXCEPTION: RED,
MACHINE_HALTED: RED,
OUTPUTS_LIMIT_EXCEEDED: AMBER,
REPORTS_LIMIT_EXCEEDED: AMBER,
CYCLE_LIMIT_EXCEEDED: AMBER,
TIME_LIMIT_EXCEEDED: AMBER,
PAYLOAD_LENGTH_LIMIT_EXCEEDED: AMBER,
OVERFLOW: AMBER,
UNEXPECTED_YIELD: RED,
INVALID_OUTPUTS_ROOT: RED,
// match winner / deletion
ONE: GREEN,
TWO: GREEN,
STEP: VIOLET,
TIMEOUT: AMBER,
CHILD_TOURNAMENT: INDIGO,
NOT_DELETED: GRAY,
// tournament progress (UI-derived)
FINISHED: GREEN,
IN_PROGRESS: BLUE,
// match phase / timeout outcome
UNINITIALIZED: GRAY,
BISECTING: BLUE,
READY_TO_SEAL: AMBER,
SEALED: VIOLET,
ONE_WINS: GREEN,
TWO_WINS: GREEN,
ELIMINATE_BOTH: RED,
// tournament kind / standing
LEAF: VIOLET,
NON_LEAF: INDIGO,
MATCHES_ACTIVE: BLUE,
AWAITING_CLOSURE: AMBER,
ROOT_WINNER: GREEN,
ROOT_FAILED: RED,
INNER_WINNER: GREEN,
INNER_ELIMINABLE_NO_WINNER: RED,
INNER_ELIMINABLE_WINNER_EXPIRED: RED,
// inner tournament / bond disposition
UNSETTLED: BLUE,
WINNER: GREEN,
ELIMINABLE: RED,
TOURNAMENT_RUNNING: BLUE,
NO_WINNER: GRAY,
RECOVERABLE: AMBER,
RECOVERED: GREEN,
// bond event type
PARTIAL_BOND_REFUND: INDIGO,
BOND_RECOVERED: GREEN,
// node default block
FINALIZED: GREEN,
SAFE: BLUE,
LATEST: AMBER,
PENDING: GRAY,
};

/** Decoder tag colors → theme-aware pill styles; keyed by TagColor so the compiler flags drift. */
Expand Down
4 changes: 2 additions & 2 deletions apps/explorer/src/decoder/useDecodedPayload.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useQuery } from "@tanstack/react-query";
import type { Deposit, Input } from "@deroll/decoder";
import { useChainId } from "@cartesi/react";
import { useNodeInfo } from "@cartesi/react";
import { loadDecoder } from "./loader";
import { decodePortalInput, hasDepositAppData } from "./portals";
import { useDecoderUrl } from "./registry";
Expand Down Expand Up @@ -53,7 +53,7 @@ export function useDecodedPayload(
props?: DecodeProps,
): DecodedPayload {
const url = useDecoderUrl(props?.application);
const chainId = useChainId({}).data;
const chainId = useNodeInfo({}).data?.chainId;
const hasPayload = !!props && !!payload && payload !== "0x";
// Inputs are always eligible (they may be a natively-decoded deposit);
// every other payload needs a registered decoder.
Expand Down
Loading
Loading