From d33423433fe45ac137f97b43e56448cecc1fd328 Mon Sep 17 00:00:00 2001 From: Danilo Tuler Date: Tue, 13 Jan 2026 09:57:39 -0500 Subject: [PATCH 1/5] feat(sdk): switching back chainId from 13370 to 31337 --- .changeset/clean-boxes-hope.md | 5 +++++ packages/sdk/devnet | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 .changeset/clean-boxes-hope.md diff --git a/.changeset/clean-boxes-hope.md b/.changeset/clean-boxes-hope.md new file mode 100644 index 00000000..dd4e33c7 --- /dev/null +++ b/.changeset/clean-boxes-hope.md @@ -0,0 +1,5 @@ +--- +"@cartesi/sdk": patch +--- + +switching back chainId from 13370 to 31337 diff --git a/packages/sdk/devnet b/packages/sdk/devnet index 575a3e46..ec999f66 100755 --- a/packages/sdk/devnet +++ b/packages/sdk/devnet @@ -1,4 +1,4 @@ #!/bin/sh set -e jq -rs '. | map({contractName,address}) | unique_by(.address) | sort_by(.contractName) | .[] | "\(.address) \(.contractName)"' /usr/share/cartesi/deployments/*.json -exec anvil --chain-id 13370 --load-state /usr/share/cartesi/anvil_state.json "$@" +exec anvil --load-state /usr/share/cartesi/anvil_state.json "$@" From 82b873c33d51abfa27e97c3921d079e6ee494425 Mon Sep 17 00:00:00 2001 From: Danilo Tuler Date: Tue, 13 Jan 2026 10:09:06 -0500 Subject: [PATCH 2/5] feat(cli): switching back chainId from 13370 to 31337 --- .changeset/neat-meals-wash.md | 5 +++++ apps/cli/src/compose/explorer.ts | 26 +++++++++++++++----------- apps/cli/src/compose/node.ts | 3 ++- apps/cli/src/config.ts | 2 +- apps/cli/src/wallet.ts | 4 ++-- apps/cli/wagmi.config.ts | 15 +++++++++------ 6 files changed, 34 insertions(+), 21 deletions(-) create mode 100644 .changeset/neat-meals-wash.md diff --git a/.changeset/neat-meals-wash.md b/.changeset/neat-meals-wash.md new file mode 100644 index 00000000..7e6bb5af --- /dev/null +++ b/.changeset/neat-meals-wash.md @@ -0,0 +1,5 @@ +--- +"@cartesi/cli": patch +--- + +switching back chainId from 13370 to 31337 diff --git a/apps/cli/src/compose/explorer.ts b/apps/cli/src/compose/explorer.ts index 8723d331..5dfa438c 100644 --- a/apps/cli/src/compose/explorer.ts +++ b/apps/cli/src/compose/explorer.ts @@ -1,3 +1,4 @@ +import { anvil } from "viem/chains"; import type { ComposeFile, Config, Service } from "../types/compose.js"; import { DEFAULT_HEALTHCHECK } from "./common.js"; @@ -75,19 +76,21 @@ export const squidProcessorService = (options: ServiceOptions): Service => { const databasePassword = options.databasePassword; const databaseHost = options.databaseHost ?? "database"; const databasePort = options.databasePort ?? 5432; + const chain = anvil; + const environment: Record = { + DB_HOST: databaseHost, + DB_NAME: "explorer", + DB_PASS: databasePassword, + DB_PORT: databasePort.toString(), + CHAIN_IDS: chain.id.toString(), + }; + environment[`RPC_URL_${chain.id}`] = `http://anvil:8545`; + environment[`BLOCK_CONFIRMATIONS_${chain.id}`] = 0; + environment[`GENESIS_BLOCK_${chain.id}`] = 1; return { image: `cartesi/rollups-explorer-api:${imageTag}`, - environment: { - DB_HOST: databaseHost, - DB_NAME: "explorer", - DB_PASS: databasePassword, - DB_PORT: databasePort.toString(), - CHAIN_IDS: "13370", - RPC_URL_13370: "http://anvil:8545", - BLOCK_CONFIRMATIONS_13370: 0, - GENESIS_BLOCK_13370: 1, - }, + environment, command: ["sqd", "process:prod"], depends_on: { database: { condition: "service_healthy" }, @@ -106,8 +109,9 @@ export const explorerService = (options: ServiceOptions): Service => { return { image: `cartesi/rollups-explorer:${imageTag}`, environment: { - NODE_RPC_URL: nodeRpcUrl, + CHAIN_ID: 31337, EXPLORER_API_URL: explorerApiUrl, + NODE_RPC_URL: nodeRpcUrl, }, expose: ["3000"], depends_on: { diff --git a/apps/cli/src/compose/node.ts b/apps/cli/src/compose/node.ts index b655296a..42a03180 100644 --- a/apps/cli/src/compose/node.ts +++ b/apps/cli/src/compose/node.ts @@ -1,3 +1,4 @@ +import { anvil } from "viem/chains"; import { daveAppFactoryAddress, inputBoxAddress, @@ -60,7 +61,7 @@ const service = (options: ServiceOptions): Service => { CARTESI_AUTH_MNEMONIC: mnemonic, CARTESI_BLOCKCHAIN_DEFAULT_BLOCK: defaultBlock, CARTESI_BLOCKCHAIN_HTTP_ENDPOINT: "http://anvil:8545", - CARTESI_BLOCKCHAIN_ID: "13370", + CARTESI_BLOCKCHAIN_ID: anvil.id.toString(), CARTESI_BLOCKCHAIN_WS_ENDPOINT: "ws://anvil:8545", CARTESI_CONTRACTS_DAVE_APP_FACTORY_ADDRESS: daveAppFactoryAddress, CARTESI_CONTRACTS_INPUT_BOX_ADDRESS: inputBoxAddress, diff --git a/apps/cli/src/config.ts b/apps/cli/src/config.ts index a5dbdf8d..2d49ac59 100644 --- a/apps/cli/src/config.ts +++ b/apps/cli/src/config.ts @@ -73,7 +73,7 @@ export class InvalidStringArrayError extends Error { */ const DEFAULT_FORMAT = "ext2"; const DEFAULT_RAM = "128Mi"; -export const DEFAULT_SDK_VERSION = "0.12.0-alpha.30"; +export const DEFAULT_SDK_VERSION = "0.12.0-alpha.31"; export const DEFAULT_SDK_IMAGE = "cartesi/sdk"; export const PREFERRED_PORT = 6751; diff --git a/apps/cli/src/wallet.ts b/apps/cli/src/wallet.ts index 560cbba0..ecbc8d86 100644 --- a/apps/cli/src/wallet.ts +++ b/apps/cli/src/wallet.ts @@ -6,13 +6,13 @@ import { publicActions, walletActions, } from "viem"; -import { cannon } from "viem/chains"; +import { anvil } from "viem/chains"; import { getProjectName } from "./base.js"; import { PREFERRED_PORT } from "./config.js"; import { getProjectPort } from "./exec/rollups.js"; export const cartesi = defineChain({ - ...cannon, + ...anvil, name: "Cartesi Devnet", testnet: true, }); diff --git a/apps/cli/wagmi.config.ts b/apps/cli/wagmi.config.ts index bc71dffe..61774768 100644 --- a/apps/cli/wagmi.config.ts +++ b/apps/cli/wagmi.config.ts @@ -2,13 +2,16 @@ import { type Plugin, defineConfig } from "@wagmi/cli"; import { readFileSync, readdirSync } from "node:fs"; import path from "node:path"; -interface CannonOptions { +interface DeploymentsOptions { directory: string; includes?: RegExp[]; excludes?: RegExp[]; } -const shouldIncludeFile = (name: string, config: CannonOptions): boolean => { +const shouldIncludeFile = ( + name: string, + config: DeploymentsOptions, +): boolean => { if (config.excludes) { // if there is a list of excludes, then if the name matches any of them, then exclude for (const exclude of config.excludes) { @@ -30,11 +33,11 @@ const shouldIncludeFile = (name: string, config: CannonOptions): boolean => { return true; }; -const cannonDeployments = (config: CannonOptions): Plugin => { +const deployments = (config: DeploymentsOptions): Plugin => { return { - name: "cannon", + name: "cartesi", contracts: () => { - // list all files exported by cannon in directory + // list all files exported by devnet in directory const files = readdirSync(config.directory).filter((file) => shouldIncludeFile(file, config), ); @@ -60,7 +63,7 @@ const cannonDeployments = (config: CannonOptions): Plugin => { export default defineConfig({ out: "src/contracts.ts", plugins: [ - cannonDeployments({ + deployments({ directory: "node_modules/@cartesi/devnet/deployments", }), ], From 35133681c84fb07fea9a04d72fc495b6ccb20d3f Mon Sep 17 00:00:00 2001 From: Danilo Tuler Date: Tue, 13 Jan 2026 11:21:00 -0500 Subject: [PATCH 3/5] chore: switching formatter from prettier to biome --- .changeset/good-turkeys-speak.md | 5 +++++ .prettierignore | 8 -------- .prettierrc.json | 3 --- .vscode/settings.json | 4 ++-- apps/cli/biome.json | 8 ++------ apps/cli/package.json | 3 --- apps/cli/src/exec/index.ts | 1 - biome.json | 10 +++++++++- bun.lock | 4 +--- package.json | 4 +--- packages/mock-verifying-paymaster/src/relay.ts | 13 +++++-------- turbo.json | 1 - 12 files changed, 25 insertions(+), 39 deletions(-) create mode 100644 .changeset/good-turkeys-speak.md delete mode 100644 .prettierignore delete mode 100644 .prettierrc.json diff --git a/.changeset/good-turkeys-speak.md b/.changeset/good-turkeys-speak.md new file mode 100644 index 00000000..f8a6798d --- /dev/null +++ b/.changeset/good-turkeys-speak.md @@ -0,0 +1,5 @@ +--- +"@cartesi/cli": patch +--- + +migrate format from prettier to biome diff --git a/.prettierignore b/.prettierignore deleted file mode 100644 index ac7a77d7..00000000 --- a/.prettierignore +++ /dev/null @@ -1,8 +0,0 @@ -.changeset -.turbo -artifacts -cache -deployments -dist -export -generated diff --git a/.prettierrc.json b/.prettierrc.json deleted file mode 100644 index 0a02bcef..00000000 --- a/.prettierrc.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "tabWidth": 4 -} diff --git a/.vscode/settings.json b/.vscode/settings.json index b964237c..5a69aadb 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,11 +1,11 @@ { "editor.formatOnPaste": true, "editor.formatOnSave": true, - "editor.defaultFormatter": "esbenp.prettier-vscode", + "editor.defaultFormatter": "biomejs.biome", "editor.codeActionsOnSave": { "source.organizeImports": "explicit" }, "[typescript]": { - "editor.defaultFormatter": "esbenp.prettier-vscode" + "editor.defaultFormatter": "biomejs.biome" } } diff --git a/apps/cli/biome.json b/apps/cli/biome.json index 0d41e4c5..18debe84 100644 --- a/apps/cli/biome.json +++ b/apps/cli/biome.json @@ -1,16 +1,12 @@ { "$schema": "https://biomejs.dev/schemas/2.3.11/schema.json", - "extends": ["../../biome.json"], + "root": false, + "extends": "//", "linter": { "rules": { "complexity": { "noBannedTypes": "off" } } - }, - "vcs": { - "enabled": true, - "clientKind": "git", - "useIgnoreFile": true } } diff --git a/apps/cli/package.json b/apps/cli/package.json index 2ae2e9b7..7e7fc33b 100644 --- a/apps/cli/package.json +++ b/apps/cli/package.json @@ -41,7 +41,6 @@ "yaml": "^2.8.2" }, "devDependencies": { - "@biomejs/biome": "^2.2.4", "@cartesi/devnet": "2.0.0-alpha.9", "@cartesi/rollups": "2.1.1", "@types/bun": "^1.3.5", @@ -69,8 +68,6 @@ "codegen": "run-p codegen:wagmi", "codegen:wagmi": "wagmi generate", "compile": "bun build.ts", - "lint": "biome lint", - "posttest": "bun lint", "test": "vitest" }, "engines": { diff --git a/apps/cli/src/exec/index.ts b/apps/cli/src/exec/index.ts index 6b0db6a6..897af549 100644 --- a/apps/cli/src/exec/index.ts +++ b/apps/cli/src/exec/index.ts @@ -1,4 +1,3 @@ export * as cartesiMachine from "./cartesi-machine.js"; export * as genext2fs from "./genext2fs.js"; export * as mksquashfs from "./mksquashfs.js"; - diff --git a/biome.json b/biome.json index 0ad211b8..c4b4f6c2 100644 --- a/biome.json +++ b/biome.json @@ -8,12 +8,20 @@ } }, "formatter": { - "enabled": false + "enabled": true, + "includes": ["**", "!.changeset/pre.json"], + "indentStyle": "space", + "indentWidth": 4 }, "linter": { "enabled": true, "rules": { "recommended": true } + }, + "vcs": { + "enabled": true, + "clientKind": "git", + "useIgnoreFile": true } } diff --git a/bun.lock b/bun.lock index 30f90e44..4457965a 100644 --- a/bun.lock +++ b/bun.lock @@ -8,13 +8,12 @@ "@biomejs/biome": "^2.3.11", "@changesets/cli": "^2.29.8", "@types/bun": "^1.3.5", - "prettier": "^3.7.4", "turbo": "^2.7.4", }, }, "apps/cli": { "name": "@cartesi/cli", - "version": "2.0.0-alpha.23", + "version": "2.0.0-alpha.24", "bin": { "cartesi": "./dist/index.js", }, @@ -45,7 +44,6 @@ "yaml": "^2.8.2", }, "devDependencies": { - "@biomejs/biome": "^2.2.4", "@cartesi/devnet": "2.0.0-alpha.9", "@cartesi/rollups": "2.1.1", "@types/bun": "^1.3.5", diff --git a/package.json b/package.json index 81d1d2e4..1c0664bc 100644 --- a/package.json +++ b/package.json @@ -7,8 +7,7 @@ "build": "turbo run build", "clean": "turbo run clean", "dev": "turbo run dev --parallel", - "lint": "turbo run lint", - "format": "prettier --write \"**/*.{cjs,css,json,md,mjs,ts,tsx}\"", + "lint": "biome ci", "publish-packages": "bun changeset publish && git push --follow-tags", "test": "turbo test" }, @@ -16,7 +15,6 @@ "@biomejs/biome": "^2.3.11", "@changesets/cli": "^2.29.8", "@types/bun": "^1.3.5", - "prettier": "^3.7.4", "turbo": "^2.7.4" }, "packageManager": "bun@1.3.5", diff --git a/packages/mock-verifying-paymaster/src/relay.ts b/packages/mock-verifying-paymaster/src/relay.ts index 864ca495..04196ac3 100644 --- a/packages/mock-verifying-paymaster/src/relay.ts +++ b/packages/mock-verifying-paymaster/src/relay.ts @@ -68,7 +68,7 @@ const handleMethodV06 = async ( if (estimateGas) { let gasEstimates: | EstimateUserOperationGasReturnType - | undefined = undefined; + | undefined; try { gasEstimates = await altoBundlerV06.estimateUserOperationGas({ userOperation: op, @@ -171,7 +171,7 @@ const handleMethodV07 = async ( if (estimateGas) { let gasEstimates: | EstimateUserOperationGasReturnType - | undefined = undefined; + | undefined; try { gasEstimates = await altoBundlerV07.estimateUserOperationGas({ userOperation: op, @@ -445,12 +445,9 @@ export const createRpcHandler = ( console.log(`JSON.stringify(err): ${util.inspect(err)}`); const error = { - // biome-ignore lint/suspicious/noExplicitAny: - message: (err as any).message, - // biome-ignore lint/suspicious/noExplicitAny: - data: (err as any).data, - // biome-ignore lint/suspicious/noExplicitAny: - code: (err as any).code ?? -32603, + message: (err as unknown as { message: string }).message, + data: (err as unknown as { data: unknown }).data, + code: (err as unknown as { code: number }).code ?? -32603, }; return { diff --git a/turbo.json b/turbo.json index fc16336a..85d36de1 100644 --- a/turbo.json +++ b/turbo.json @@ -23,7 +23,6 @@ "cache": false, "persistent": true }, - "lint": {}, "start": { "dependsOn": ["^build"] }, From 25d5a697fc9ba9f24bfd19ee326a4fda861dc2ad Mon Sep 17 00:00:00 2001 From: Danilo Tuler Date: Tue, 13 Jan 2026 11:21:11 -0500 Subject: [PATCH 4/5] chore: bump bun --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 1c0664bc..a5a0d52b 100644 --- a/package.json +++ b/package.json @@ -17,7 +17,7 @@ "@types/bun": "^1.3.5", "turbo": "^2.7.4" }, - "packageManager": "bun@1.3.5", + "packageManager": "bun@1.3.6", "workspaces": [ "apps/*", "packages/*" From a3f87cc010475be463e1ba687658d8cde57a6968 Mon Sep 17 00:00:00 2001 From: Danilo Tuler Date: Tue, 13 Jan 2026 11:22:08 -0500 Subject: [PATCH 5/5] =?UTF-8?q?ci:=20using=20=E2=80=94frozen-lockfifle=20f?= =?UTF-8?q?or=20consistency?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/cli.yaml | 2 +- .github/workflows/devnet.yaml | 2 +- .github/workflows/lint.yaml | 2 +- .github/workflows/paymaster.yaml | 2 +- .github/workflows/release.yaml | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/cli.yaml b/.github/workflows/cli.yaml index cae8532e..08b8e83c 100644 --- a/.github/workflows/cli.yaml +++ b/.github/workflows/cli.yaml @@ -30,7 +30,7 @@ jobs: version: v1.4.3 - name: Install dependencies - run: bun install + run: bun install --frozen-lockfile - name: Build run: bun run build --filter @cartesi/cli diff --git a/.github/workflows/devnet.yaml b/.github/workflows/devnet.yaml index 9819cbc8..dc333956 100644 --- a/.github/workflows/devnet.yaml +++ b/.github/workflows/devnet.yaml @@ -29,7 +29,7 @@ jobs: version: v1.4.3 - name: Install dependencies - run: bun install + run: bun install --frozen-lockfile - name: Build run: bun run build --filter @cartesi/devnet diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index 3d368555..80515490 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -16,7 +16,7 @@ jobs: - uses: oven-sh/setup-bun@b7a1c7ccf290d58743029c4f6903da283811b979 # v2.1.0 - name: Install dependencies - run: bun install + run: bun install --frozen-lockfile - name: Lint run: bun run lint diff --git a/.github/workflows/paymaster.yaml b/.github/workflows/paymaster.yaml index 9f8f1bc9..305751bc 100644 --- a/.github/workflows/paymaster.yaml +++ b/.github/workflows/paymaster.yaml @@ -29,7 +29,7 @@ jobs: version: v1.4.3 - name: Install dependencies - run: bun install + run: bun install --frozen-lockfile - name: Build run: bun run build --filter @cartesi/mock-verifying-paymaster diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 790efb60..875b380c 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -40,7 +40,7 @@ jobs: version: v1.4.3 - name: Install Dependencies - run: bun install + run: bun install --frozen-lockfile - name: Build run: bun run build