From 6dae7394fd13020c27da71d5bb44c1b5d844cb27 Mon Sep 17 00:00:00 2001 From: StackOverflowExcept1on <109800286+StackOverflowExcept1on@users.noreply.github.com> Date: Sun, 29 Mar 2026 02:05:25 +0300 Subject: [PATCH 01/19] feat(apis/vara-eth, idea/vara-eth): return back button for uploading codes --- .github/workflows/CI.yml | 4 +- apis/vara-eth/Cargo.lock | 6 +- apis/vara-eth/Cargo.toml | 2 +- apis/vara-eth/package.json | 4 +- apis/vara-eth/src/eth/router.ts | 14 +++- apis/vara-eth/test/router.test.ts | 41 +++++------ idea/gear/faucet/package.json | 2 +- idea/vara-eth/frontend/package.json | 2 +- .../src/components/navigation/navigation.tsx | 10 +-- .../frontend/src/features/codes/index.ts | 1 + .../frontend/src/features/codes/lib/index.ts | 1 + .../src/features/codes/lib/use-upload-code.ts | 37 ++++++++++ .../frontend/src/features/codes/ui/index.ts | 1 + .../codes/ui/upload-code-button/index.ts | 1 + .../upload-code-button.module.scss | 3 + .../upload-code-button/upload-code-button.tsx | 68 +++++++++++++++++++ idea/vara-eth/indexer/package.json | 2 +- rust-toolchain.toml | 2 +- yarn.lock | 54 +++++++++++++-- 19 files changed, 208 insertions(+), 47 deletions(-) create mode 100644 idea/vara-eth/frontend/src/features/codes/lib/use-upload-code.ts create mode 100644 idea/vara-eth/frontend/src/features/codes/ui/index.ts create mode 100644 idea/vara-eth/frontend/src/features/codes/ui/upload-code-button/index.ts create mode 100644 idea/vara-eth/frontend/src/features/codes/ui/upload-code-button/upload-code-button.module.scss create mode 100644 idea/vara-eth/frontend/src/features/codes/ui/upload-code-button/upload-code-button.tsx diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 1fea637ae9..1e35d2106c 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -86,6 +86,8 @@ jobs: - name: "Install: Foundry" uses: foundry-rs/foundry-toolchain@v1 + with: + version: nightly-c07d504b4ae67754584f4e05ff0c547a43c50f7b - name: 'Install dependencies' run: yarn workspaces focus gear-js @gear-js/api @@ -153,7 +155,7 @@ jobs: if: steps.changed-vara-eth.outputs.any_changed == 'true' uses: foundry-rs/foundry-toolchain@v1 with: - version: v1.5.0-rc1 + version: nightly-c07d504b4ae67754584f4e05ff0c547a43c50f7b - name: 'Install dependencies' if: steps.changed-vara-eth.outputs.any_changed == 'true' diff --git a/apis/vara-eth/Cargo.lock b/apis/vara-eth/Cargo.lock index 22ccfe2192..ade9fc2201 100644 --- a/apis/vara-eth/Cargo.lock +++ b/apis/vara-eth/Cargo.lock @@ -881,14 +881,14 @@ checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" [[package]] name = "counter" -version = "0.0.1" +version = "0.1.0" dependencies = [ "sails-rs", ] [[package]] name = "counter-idl" -version = "0.0.1" +version = "0.1.0" dependencies = [ "counter", "sails-rs", @@ -2458,7 +2458,7 @@ dependencies = [ [[package]] name = "injected" -version = "0.0.1" +version = "0.1.0" dependencies = [ "ethexe-common", "gear-core 1.10.0 (git+https://github.com/gear-tech/gear)", diff --git a/apis/vara-eth/Cargo.toml b/apis/vara-eth/Cargo.toml index f4c448938d..bafb7b0622 100644 --- a/apis/vara-eth/Cargo.toml +++ b/apis/vara-eth/Cargo.toml @@ -1,5 +1,5 @@ [workspace.package] -version = "0.0.1" +version = "0.1.0" authors = ["Gear Technologies"] edition = "2024" license = "GPL-3.0" diff --git a/apis/vara-eth/package.json b/apis/vara-eth/package.json index 4ce6e2d158..444d8c5f31 100644 --- a/apis/vara-eth/package.json +++ b/apis/vara-eth/package.json @@ -39,12 +39,12 @@ }, "peerDependencies": { "kzg-wasm": "1.0.0", - "viem": "^2.39.0" + "viem": "*" }, "devDependencies": { "@types/ws": "8.18.1", "kzg-wasm": "1.0.0", - "viem": "2.47.4", + "viem": "https://pkg.pr.new/StackOverflowExcept1on/viem/viem@98e8516", "ws": "8.18.3" }, "files": [ diff --git a/apis/vara-eth/src/eth/router.ts b/apis/vara-eth/src/eth/router.ts index f8213b371e..adb0d1bce8 100644 --- a/apis/vara-eth/src/eth/router.ts +++ b/apis/vara-eth/src/eth/router.ts @@ -225,8 +225,7 @@ export class RouterClient extends BaseContractClient implements IRouterContract * @returns A transaction manager with validation-specific helper functions, including * the code ID and a function to wait for the code to be validated */ - private async requestCodeValidation(code: Uint8Array): Promise> { - throw new Error('Not implemented'); + public async requestCodeValidation(code: Uint8Array): Promise> { const codeId = generateCodeHash(code); const data = encodeFunctionData({ @@ -245,6 +244,7 @@ export class RouterClient extends BaseContractClient implements IRouterContract const tx = { type: 'eip4844' as const, + blobVersion: '7594' as const, data, to: this.address, gas: 5_000_000n, @@ -259,6 +259,16 @@ export class RouterClient extends BaseContractClient implements IRouterContract const result = kzg.computeBlobKZGProof(bytesToHex(blob), bytesToHex(commitment)) as Hex; return hexToBytes(result); }, + computeCellsAndKzgProofs: (blob: Uint8Array): [Uint8Array[], Uint8Array[]] => { + const [cells, proofs] = kzg.computeCellsAndProofs(bytesToHex(blob)) as [ + `0x${string}`[], + `0x${string}`[], + ] + return [ + cells.map((cell) => hexToBytes(cell)), + proofs.map((proof) => hexToBytes(proof)), + ] + } }, chain: null, }; diff --git a/apis/vara-eth/test/router.test.ts b/apis/vara-eth/test/router.test.ts index b643590e6e..f1a718d790 100644 --- a/apis/vara-eth/test/router.test.ts +++ b/apis/vara-eth/test/router.test.ts @@ -7,15 +7,16 @@ import path from 'path'; import { CodeState, getMirrorClient, getRouterClient, RouterClient, type ITransactionSigner } from '../src'; import { config } from './config'; import { walletClientToSigner } from '../src/signer'; +import { waitNBlocks } from "./common"; -// const code = fs.readFileSync(path.join(config.targetDir, 'counter.opt.wasm')); +const code = fs.readFileSync(path.join(config.targetDir, 'counter.opt.wasm')); let codeId: `0x${string}`; let publicClient: PublicClient; let walletClient: WalletClient; let signer: ITransactionSigner; let router: RouterClient; -// let codeValidatedPromise: Promise; +let codeValidatedPromise: Promise; beforeAll(async () => { const transport = webSocket(config.wsRpc); @@ -41,24 +42,24 @@ afterAll(async () => { describe('router', () => { describe('upload code', () => { - // test.skip('should request code validation', async () => { - // const tx = await ethereumClient.router.requestCodeValidation(code); - // codeId = tx.codeId; - // const receipt = await tx.sendAndWaitForReceipt(); - // expect(receipt.blockHash).toBeDefined(); - // codeValidatedPromise = tx.waitForCodeGotValidated(); - // }, 60_000); - - // test.skip( - // 'should wait when code got validated', - // async () => { - // expect(await codeValidatedPromise).toBeTruthy(); - // await waitNBlocks(5); - - // console.log(codeId); - // }, - // config.longRunningTestTimeout, - // ); + test('should request code validation', async () => { + const tx = await router.requestCodeValidation(code); + codeId = tx.codeId; + const receipt = await tx.sendAndWaitForReceipt(); + expect(receipt.blockHash).toBeDefined(); + codeValidatedPromise = tx.waitForCodeGotValidated(); + }, 60_000); + + test.skip( + 'should wait when code got validated', + async () => { + expect(await codeValidatedPromise).toBeTruthy(); + await waitNBlocks(5); + + console.log(codeId); + }, + config.longRunningTestTimeout, + ); test('should check that code state is Validated', async () => { expect(await router.codeState(codeId)).toBe(CodeState.Validated); diff --git a/idea/gear/faucet/package.json b/idea/gear/faucet/package.json index ad5f86784f..c0bffdb2e6 100644 --- a/idea/gear/faucet/package.json +++ b/idea/gear/faucet/package.json @@ -27,7 +27,7 @@ "reflect-metadata": "0.2.2", "swagger-ui-express": "5.0.1", "typeorm": "0.3.28", - "viem": "^2.40.2", + "viem": "https://pkg.pr.new/StackOverflowExcept1on/viem/viem@98e8516", "winston": "3.19.0", "xxhashjs": "0.2.2", "yamljs": "0.3.0" diff --git a/idea/vara-eth/frontend/package.json b/idea/vara-eth/frontend/package.json index 19a4551346..9149570155 100644 --- a/idea/vara-eth/frontend/package.json +++ b/idea/vara-eth/frontend/package.json @@ -26,7 +26,7 @@ "react-syntax-highlighter": "15.6.6", "sails-js": "0.5.1", "sails-js-parser": "0.5.1", - "viem": "2.47.4", + "viem": "https://pkg.pr.new/StackOverflowExcept1on/viem/viem@98e8516", "wagmi": "2.19.4", "zod": "4.3.6" }, diff --git a/idea/vara-eth/frontend/src/components/navigation/navigation.tsx b/idea/vara-eth/frontend/src/components/navigation/navigation.tsx index e3049b34ce..06d9bc2cc0 100644 --- a/idea/vara-eth/frontend/src/components/navigation/navigation.tsx +++ b/idea/vara-eth/frontend/src/components/navigation/navigation.tsx @@ -2,12 +2,11 @@ import { clsx } from 'clsx'; import { matchPath, NavLink, useLocation } from 'react-router-dom'; import { Hex } from 'viem'; +import { UploadCodeButton } from '@/features/codes'; import { CreateProgramButton } from '@/features/programs'; import { Search } from '@/features/search'; import { routes } from '@/shared/config'; -import { LinkButton } from '../ui'; - import styles from './navigation.module.scss'; const LINKS = [ @@ -32,13 +31,8 @@ const Navigation = () => {
{renderLinks()}
- {matchPath(routes.codes, pathname) && ( - - Upload Code - - )} - {codeId && } + {matchPath(routes.codes, pathname) && }
{/* key to reset search on route change */} diff --git a/idea/vara-eth/frontend/src/features/codes/index.ts b/idea/vara-eth/frontend/src/features/codes/index.ts index a3b47683c4..3732853821 100644 --- a/idea/vara-eth/frontend/src/features/codes/index.ts +++ b/idea/vara-eth/frontend/src/features/codes/index.ts @@ -1 +1,2 @@ +export { UploadCodeButton } from './ui'; export { useGetAllCodesQuery, CODE_STATUS } from './lib'; diff --git a/idea/vara-eth/frontend/src/features/codes/lib/index.ts b/idea/vara-eth/frontend/src/features/codes/lib/index.ts index 482a0d4073..2247e7fc28 100644 --- a/idea/vara-eth/frontend/src/features/codes/lib/index.ts +++ b/idea/vara-eth/frontend/src/features/codes/lib/index.ts @@ -1 +1,2 @@ +export { useUploadCode } from './use-upload-code'; export { useGetAllCodesQuery, CODE_STATUS } from './queries'; diff --git a/idea/vara-eth/frontend/src/features/codes/lib/use-upload-code.ts b/idea/vara-eth/frontend/src/features/codes/lib/use-upload-code.ts new file mode 100644 index 0000000000..74b33b0857 --- /dev/null +++ b/idea/vara-eth/frontend/src/features/codes/lib/use-upload-code.ts @@ -0,0 +1,37 @@ +import { useMutation } from '@tanstack/react-query'; +import { generatePath, useNavigate } from 'react-router-dom'; + +import { useApi } from '@/app/api'; +import { useAddMyActivity } from '@/app/store'; +import { TransactionTypes, unpackReceipt } from '@/app/store/my-activity'; +import { routes } from '@/shared/config'; + +export const useUploadCode = () => { + const { data: api } = useApi(); + const navigate = useNavigate(); + const addMyActivity = useAddMyActivity(); + + const uploadCode = async (code: Uint8Array) => { + if (!api) return; + + const tx = await api.eth.router.requestCodeValidation(code); + await tx.send(); + const isValidated = await tx.waitForCodeGotValidated(); + const codeId = tx.codeId; + const receipt = await tx.getReceipt(); + + await addMyActivity({ + type: TransactionTypes.codeValidation, + codeId, + resultStatus: isValidated ? 'success' : 'error', + error: isValidated ? undefined : 'validation error', + ...unpackReceipt(receipt), + }); + + void navigate(generatePath(routes.code, { codeId })); + }; + + const mutation = useMutation({ mutationFn: uploadCode }); + + return mutation; +}; diff --git a/idea/vara-eth/frontend/src/features/codes/ui/index.ts b/idea/vara-eth/frontend/src/features/codes/ui/index.ts new file mode 100644 index 0000000000..1c161e333e --- /dev/null +++ b/idea/vara-eth/frontend/src/features/codes/ui/index.ts @@ -0,0 +1 @@ +export { UploadCodeButton } from './upload-code-button'; diff --git a/idea/vara-eth/frontend/src/features/codes/ui/upload-code-button/index.ts b/idea/vara-eth/frontend/src/features/codes/ui/upload-code-button/index.ts new file mode 100644 index 0000000000..1c161e333e --- /dev/null +++ b/idea/vara-eth/frontend/src/features/codes/ui/upload-code-button/index.ts @@ -0,0 +1 @@ +export { UploadCodeButton } from './upload-code-button'; diff --git a/idea/vara-eth/frontend/src/features/codes/ui/upload-code-button/upload-code-button.module.scss b/idea/vara-eth/frontend/src/features/codes/ui/upload-code-button/upload-code-button.module.scss new file mode 100644 index 0000000000..a48ce97be9 --- /dev/null +++ b/idea/vara-eth/frontend/src/features/codes/ui/upload-code-button/upload-code-button.module.scss @@ -0,0 +1,3 @@ +.input { + display: none; +} diff --git a/idea/vara-eth/frontend/src/features/codes/ui/upload-code-button/upload-code-button.tsx b/idea/vara-eth/frontend/src/features/codes/ui/upload-code-button/upload-code-button.tsx new file mode 100644 index 0000000000..760a8fa620 --- /dev/null +++ b/idea/vara-eth/frontend/src/features/codes/ui/upload-code-button/upload-code-button.tsx @@ -0,0 +1,68 @@ +import { useRef, useState } from 'react'; +import { useAccount } from 'wagmi'; + +import { Button, Modal } from '@/components'; +import { useUploadCode } from '@/features/codes/lib'; + +import styles from './upload-code-button.module.scss'; + +export const UploadCodeButton = () => { + const uploadCode = useUploadCode(); + const inputRef = useRef(null); + const [isOpen, setIsOpen] = useState(false); + const { address } = useAccount(); + + if (!address) return null; + + const onSelectFile = () => { + inputRef.current?.click(); + }; + + const handleFileUpload: React.ChangeEventHandler = (event) => { + const file = event.target.files?.[0]; + if (!file) return; + + const reader = new FileReader(); + reader.onload = function () { + const arrayBuffer = reader.result; + if (!arrayBuffer || typeof arrayBuffer === 'string') return; + const uint8Array = new Uint8Array(arrayBuffer); + + uploadCode.mutate(uint8Array, { + onError: () => { + setIsOpen(false); + }, + }); + }; + reader.readAsArrayBuffer(file); + }; + + return ( + <> + + + {isOpen && ( + setIsOpen(false)} + action={ + + }> + {/* TODO: add drop area */} + + + )} + + ); +}; diff --git a/idea/vara-eth/indexer/package.json b/idea/vara-eth/indexer/package.json index 69916e3940..a2099f80a0 100644 --- a/idea/vara-eth/indexer/package.json +++ b/idea/vara-eth/indexer/package.json @@ -36,7 +36,7 @@ "reflect-metadata": "^0.2.2", "rxjs": "^7.8.2", "typeorm": "0.3.28", - "viem": "2.47.4", + "viem": "https://pkg.pr.new/StackOverflowExcept1on/viem/viem@98e8516", "xxhash-addon": "^2.0.3" }, "devDependencies": { diff --git a/rust-toolchain.toml b/rust-toolchain.toml index 9e0a4d7840..5bc1bb0b75 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,4 +1,4 @@ [toolchain] -channel = "1.91" +channel = "stable" targets = ["wasm32-unknown-unknown", "wasm32v1-none"] components = ["rustfmt", "clippy", "rust-src", "llvm-tools"] diff --git a/yarn.lock b/yarn.lock index 3d16e31b0e..57f9f7fcd6 100644 --- a/yarn.lock +++ b/yarn.lock @@ -10098,11 +10098,11 @@ __metadata: "@noble/hashes": "npm:1.8.0" "@types/ws": "npm:8.18.1" kzg-wasm: "npm:1.0.0" - viem: "npm:2.47.4" + viem: "https://pkg.pr.new/StackOverflowExcept1on/viem/viem@98e8516" ws: "npm:8.18.3" peerDependencies: kzg-wasm: 1.0.0 - viem: ^2.39.0 + viem: "*" languageName: unknown linkType: soft @@ -15940,7 +15940,7 @@ __metadata: supertest: "npm:^7.1.4" swagger-ui-express: "npm:5.0.1" typeorm: "npm:0.3.28" - viem: "npm:^2.40.2" + viem: "https://pkg.pr.new/StackOverflowExcept1on/viem/viem@98e8516" winston: "npm:3.19.0" xxhashjs: "npm:0.2.2" yamljs: "npm:0.3.0" @@ -20513,6 +20513,27 @@ __metadata: languageName: node linkType: hard +"ox@npm:0.14.7": + version: 0.14.7 + resolution: "ox@npm:0.14.7" + dependencies: + "@adraffy/ens-normalize": "npm:^1.11.0" + "@noble/ciphers": "npm:^1.3.0" + "@noble/curves": "npm:1.9.1" + "@noble/hashes": "npm:^1.8.0" + "@scure/bip32": "npm:^1.7.0" + "@scure/bip39": "npm:^1.6.0" + abitype: "npm:^1.2.3" + eventemitter3: "npm:5.0.1" + peerDependencies: + typescript: ">=5.4.0" + peerDependenciesMeta: + typescript: + optional: true + checksum: 10c0/c4bc216b4e689a0d4e6d6640be30bcc7e82209e4d69c1dd2d2c10c6b3b709f658c6b3e7ebe68e590602d6b0ef15785090d890b75cc7e67a094fe50d84778b9f9 + languageName: node + linkType: hard + "ox@npm:0.6.7": version: 0.6.7 resolution: "ox@npm:0.6.7" @@ -25415,7 +25436,7 @@ __metadata: react-syntax-highlighter: "npm:15.6.6" sails-js: "npm:0.5.1" sails-js-parser: "npm:0.5.1" - viem: "npm:2.47.4" + viem: "https://pkg.pr.new/StackOverflowExcept1on/viem/viem@98e8516" wagmi: "npm:2.19.4" zod: "npm:4.3.6" languageName: unknown @@ -25449,7 +25470,7 @@ __metadata: reflect-metadata: "npm:^0.2.2" rxjs: "npm:^7.8.2" typeorm: "npm:0.3.28" - viem: "npm:2.47.4" + viem: "https://pkg.pr.new/StackOverflowExcept1on/viem/viem@98e8516" xxhash-addon: "npm:^2.0.3" languageName: unknown linkType: soft @@ -25461,6 +25482,27 @@ __metadata: languageName: node linkType: hard +"viem@https://pkg.pr.new/StackOverflowExcept1on/viem/viem@98e8516": + version: 2.47.7-98e8516.0 + resolution: "viem@https://pkg.pr.new/StackOverflowExcept1on/viem/viem@98e8516" + dependencies: + "@noble/curves": "npm:1.9.1" + "@noble/hashes": "npm:1.8.0" + "@scure/bip32": "npm:1.7.0" + "@scure/bip39": "npm:1.6.0" + abitype: "npm:1.2.3" + isows: "npm:1.0.7" + ox: "npm:0.14.7" + ws: "npm:8.18.3" + peerDependencies: + typescript: ">=5.0.4" + peerDependenciesMeta: + typescript: + optional: true + checksum: 10c0/00343320da047babb7697ea2aab7f94c302f2762ba9d2d3f322933b4fd7eb2fe9986dea3f22cf6632b2a8bde6417399bde7e6f0a05b0120bf67ab0783e9d398a + languageName: node + linkType: hard + "viem@npm:2.23.2": version: 2.23.2 resolution: "viem@npm:2.23.2" @@ -25482,7 +25524,7 @@ __metadata: languageName: node linkType: hard -"viem@npm:2.47.4, viem@npm:>=2.29.0, viem@npm:>=2.45.0, viem@npm:^2.1.1, viem@npm:^2.21.26, viem@npm:^2.27.2, viem@npm:^2.31.7, viem@npm:^2.40.2": +"viem@npm:>=2.29.0, viem@npm:>=2.45.0, viem@npm:^2.1.1, viem@npm:^2.21.26, viem@npm:^2.27.2, viem@npm:^2.31.7": version: 2.47.4 resolution: "viem@npm:2.47.4" dependencies: From d66a173166cea24bd56989e86d2c898e6d38bac1 Mon Sep 17 00:00:00 2001 From: StackOverflowExcept1on <109800286+StackOverflowExcept1on@users.noreply.github.com> Date: Mon, 30 Mar 2026 13:04:58 +0300 Subject: [PATCH 02/19] fix kzg-wasm on frontend site --- utils/frontend-configs/src/vite.ts | 33 +++++++++++++++++++++++++++--- 1 file changed, 30 insertions(+), 3 deletions(-) diff --git a/utils/frontend-configs/src/vite.ts b/utils/frontend-configs/src/vite.ts index 47e508b14a..df77c8c945 100644 --- a/utils/frontend-configs/src/vite.ts +++ b/utils/frontend-configs/src/vite.ts @@ -1,13 +1,39 @@ -import { resolve } from 'path'; +import { readFileSync } from 'fs'; +import { createRequire } from 'module'; +import { dirname, resolve } from 'path'; +import { fileURLToPath } from 'url'; import react from '@vitejs/plugin-react-swc'; -import { defineConfig } from 'vite'; +import { defineConfig, type PluginOption } from 'vite'; import { checker } from 'vite-plugin-checker'; import { nodePolyfills } from 'vite-plugin-node-polyfills'; import svgr from 'vite-plugin-svgr'; import dts from 'vite-plugin-dts'; import { externalizeDeps } from 'vite-plugin-externalize-deps'; +const require = createRequire(import.meta.url); +const __dirname = dirname(fileURLToPath(import.meta.url)); + +const serveKzgWasmFromViteCachePath = (): PluginOption => { + const kzgEntry = require.resolve('kzg-wasm', { paths: [process.cwd()] }); + const wasmPath = resolve(dirname(kzgEntry), '..', 'wasm', 'kzg.wasm'); + + return { + name: 'serve-kzg-wasm-vite-cache-path', + apply: 'serve', + configureServer(server) { + server.middlewares.use('/node_modules/.vite/wasm/kzg.wasm', (_req, res) => { + const wasm = readFileSync(wasmPath); + + res.statusCode = 200; + res.setHeader('Content-Type', 'application/wasm'); + res.setHeader('Cache-Control', 'no-store'); + res.end(wasm); + }); + }, + }; +}; + const options = { server: { port: 3000, open: true }, preview: { port: 3001, open: true }, @@ -17,7 +43,8 @@ const options = { const plugins = [ react(), svgr(), - nodePolyfills(), + serveKzgWasmFromViteCachePath(), + nodePolyfills({ globals: { process: false } }), checker({ typescript: { buildMode: true }, eslint: { lintCommand: 'eslint .', useFlatConfig: true } }), ]; From 2c152a87182af9de9cbe74c1b1015c6798ff3fc1 Mon Sep 17 00:00:00 2001 From: Dmitri Osipov Date: Mon, 30 Mar 2026 14:56:27 +0200 Subject: [PATCH 03/19] do not upload code on test setup --- apis/vara-eth/src/eth/router.ts | 13 ++++--------- apis/vara-eth/test/router.test.ts | 6 +++--- apis/vara-eth/test/setup/setup.ts | 8 ++++++-- 3 files changed, 13 insertions(+), 14 deletions(-) diff --git a/apis/vara-eth/src/eth/router.ts b/apis/vara-eth/src/eth/router.ts index adb0d1bce8..394659184d 100644 --- a/apis/vara-eth/src/eth/router.ts +++ b/apis/vara-eth/src/eth/router.ts @@ -260,15 +260,9 @@ export class RouterClient extends BaseContractClient implements IRouterContract return hexToBytes(result); }, computeCellsAndKzgProofs: (blob: Uint8Array): [Uint8Array[], Uint8Array[]] => { - const [cells, proofs] = kzg.computeCellsAndProofs(bytesToHex(blob)) as [ - `0x${string}`[], - `0x${string}`[], - ] - return [ - cells.map((cell) => hexToBytes(cell)), - proofs.map((proof) => hexToBytes(proof)), - ] - } + const [cells, proofs] = kzg.computeCellsAndProofs(bytesToHex(blob)) as [`0x${string}`[], `0x${string}`[]]; + return [cells.map((cell) => hexToBytes(cell)), proofs.map((proof) => hexToBytes(proof))]; + }, }, chain: null, }; @@ -288,6 +282,7 @@ export class RouterClient extends BaseContractClient implements IRouterContract eventName: 'CodeGotValidated', onLogs: (logs) => { for (const log of logs) { + console.log(log); if (log.args.codeId == codeId) { if (log.args.valid) { resolve(true); diff --git a/apis/vara-eth/test/router.test.ts b/apis/vara-eth/test/router.test.ts index f1a718d790..e39c915b03 100644 --- a/apis/vara-eth/test/router.test.ts +++ b/apis/vara-eth/test/router.test.ts @@ -7,7 +7,7 @@ import path from 'path'; import { CodeState, getMirrorClient, getRouterClient, RouterClient, type ITransactionSigner } from '../src'; import { config } from './config'; import { walletClientToSigner } from '../src/signer'; -import { waitNBlocks } from "./common"; +import { waitNBlocks } from './common'; const code = fs.readFileSync(path.join(config.targetDir, 'counter.opt.wasm')); let codeId: `0x${string}`; @@ -50,7 +50,7 @@ describe('router', () => { codeValidatedPromise = tx.waitForCodeGotValidated(); }, 60_000); - test.skip( + test( 'should wait when code got validated', async () => { expect(await codeValidatedPromise).toBeTruthy(); @@ -58,7 +58,7 @@ describe('router', () => { console.log(codeId); }, - config.longRunningTestTimeout, + config.longRunningTestTimeout * 5, ); test('should check that code state is Validated', async () => { diff --git a/apis/vara-eth/test/setup/setup.ts b/apis/vara-eth/test/setup/setup.ts index c0364ff02c..7eb6e7c361 100644 --- a/apis/vara-eth/test/setup/setup.ts +++ b/apis/vara-eth/test/setup/setup.ts @@ -43,6 +43,10 @@ async function setupVaraEth() { { stdio: 'pipe', detached: true, + env: { + ...process.env, + RUST_LOG: 'debug', + }, }, ); @@ -100,7 +104,7 @@ async function setupVaraEth() { process.env.ROUTER_ADDRESS = routerAddress; } -function uploadCode() { +function _uploadCode() { execSync( `${pathToEthexeBin} tx --ethereum-rpc ${ANVIL_RPC} --ethereum-router ${routerAddress} --sender ${SENDER_ADDRESS} --key-store "${keyStore}" upload ${COUNTER_CODE} -w`, { stdio: 'inherit' }, @@ -112,5 +116,5 @@ export default async () => { await setupVaraEth(); - uploadCode(); + // _uploadCode(); }; From dbeb743df40da201b2d0e931028e20939428478b Mon Sep 17 00:00:00 2001 From: StackOverflowExcept1on <109800286+StackOverflowExcept1on@users.noreply.github.com> Date: Mon, 30 Mar 2026 23:52:16 +0300 Subject: [PATCH 04/19] fix codec --- apis/vara-eth/src/eth/router.ts | 73 +++++++++++++++++++------------ apis/vara-eth/test/router.test.ts | 4 +- apis/vara-eth/test/setup/setup.ts | 9 ---- 3 files changed, 48 insertions(+), 38 deletions(-) diff --git a/apis/vara-eth/src/eth/router.ts b/apis/vara-eth/src/eth/router.ts index 394659184d..6a87daba8d 100644 --- a/apis/vara-eth/src/eth/router.ts +++ b/apis/vara-eth/src/eth/router.ts @@ -234,12 +234,7 @@ export class RouterClient extends BaseContractClient implements IRouterContract args: [codeId], }); - const blob = prepareBlob(code); - - if (blob.length != 4096 * 32) { - throw new Error('Invalid blob size'); - } - + const blobs = simpleSidecarEncode(code); const kzg = await loadKZG(); const tx = { @@ -249,7 +244,7 @@ export class RouterClient extends BaseContractClient implements IRouterContract to: this.address, gas: 5_000_000n, maxFeePerBlobGas: 400_000_000_000n, - blobs: [blob], + blobs, kzg: { blobToKzgCommitment: (blob: Uint8Array) => { const result = kzg.blobToKZGCommitment(bytesToHex(blob)) as Hex; @@ -386,25 +381,49 @@ export function getRouterClient(params: ContractClientParams): RouterClient { return new RouterClient(params); } -function prepareBlob(data: Uint8Array) { - // https://docs.rs/alloy/latest/alloy/consensus/struct.SimpleCoder.html#behavior - const BLOB_SIZE = 131_072; - const paddedData = new Uint8Array(BLOB_SIZE); - - const dataLength = numberToBytes(data.length, { size: 32 }); - const length = new Uint8Array(32); - length.set(dataLength, 0); - - paddedData.set(length, 0); - - let offset = 32; - - while (data.length > 0) { - const chunk = data.slice(0, 31); - paddedData.set(chunk, offset + 1); - offset += 32; - data = data.slice(31); +const BYTES_PER_BLOB = 131_072; +const FIELD_ELEMENTS_PER_BLOB = 4096; +const FE_BYTES = 32; +const USABLE_BYTES_PER_FE = 31; + +export function simpleSidecarEncode(data: Uint8Array): Uint8Array[] { + const blobs: Uint8Array[] = []; + let feCount = 0; + + const pushEmptyBlob = () => { + blobs.push(new Uint8Array(BYTES_PER_BLOB)); + }; + + const currentBlob = () => { + const index = Math.floor(feCount / FIELD_ELEMENTS_PER_BLOB); + while (blobs.length <= index) pushEmptyBlob(); + return blobs[index]; + }; + + const feOffsetInCurrentBlob = () => (feCount % FIELD_ELEMENTS_PER_BLOB) * FE_BYTES; + + const ingestFE = (fe: Uint8Array) => { + const blob = currentBlob(); + const offset = feOffsetInCurrentBlob(); + blob.set(fe, offset); + feCount++; + }; + + if (data.length === 0) return blobs; + + const lenFE = new Uint8Array(FE_BYTES); + const lenBytes = new DataView(lenFE.buffer); + lenBytes.setBigUint64(1, BigInt(data.length)); + ingestFE(lenFE); + + let offset = 0; + while (offset < data.length) { + const fe = new Uint8Array(FE_BYTES); + const chunkSize = Math.min(USABLE_BYTES_PER_FE, data.length - offset); + fe.set(data.subarray(offset, offset + chunkSize), 1); + offset += chunkSize; + ingestFE(fe); } - return paddedData; -} + return blobs; +} \ No newline at end of file diff --git a/apis/vara-eth/test/router.test.ts b/apis/vara-eth/test/router.test.ts index e39c915b03..aace973d69 100644 --- a/apis/vara-eth/test/router.test.ts +++ b/apis/vara-eth/test/router.test.ts @@ -50,7 +50,7 @@ describe('router', () => { codeValidatedPromise = tx.waitForCodeGotValidated(); }, 60_000); - test( + test.skip( 'should wait when code got validated', async () => { expect(await codeValidatedPromise).toBeTruthy(); @@ -58,7 +58,7 @@ describe('router', () => { console.log(codeId); }, - config.longRunningTestTimeout * 5, + config.longRunningTestTimeout, ); test('should check that code state is Validated', async () => { diff --git a/apis/vara-eth/test/setup/setup.ts b/apis/vara-eth/test/setup/setup.ts index 7eb6e7c361..b9e823addd 100644 --- a/apis/vara-eth/test/setup/setup.ts +++ b/apis/vara-eth/test/setup/setup.ts @@ -104,17 +104,8 @@ async function setupVaraEth() { process.env.ROUTER_ADDRESS = routerAddress; } -function _uploadCode() { - execSync( - `${pathToEthexeBin} tx --ethereum-rpc ${ANVIL_RPC} --ethereum-router ${routerAddress} --sender ${SENDER_ADDRESS} --key-store "${keyStore}" upload ${COUNTER_CODE} -w`, - { stdio: 'inherit' }, - ); -} - export default async () => { setupCodeId(); await setupVaraEth(); - - // _uploadCode(); }; From eebc7034d83fb0c4fd1700a601c5b30d11a000a0 Mon Sep 17 00:00:00 2001 From: StackOverflowExcept1on <109800286+StackOverflowExcept1on@users.noreply.github.com> Date: Tue, 31 Mar 2026 00:07:23 +0300 Subject: [PATCH 05/19] fix lint --- apis/vara-eth/src/eth/router.ts | 2 +- apis/vara-eth/test/setup/setup.ts | 6 +----- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/apis/vara-eth/src/eth/router.ts b/apis/vara-eth/src/eth/router.ts index 6a87daba8d..1cf1874ef5 100644 --- a/apis/vara-eth/src/eth/router.ts +++ b/apis/vara-eth/src/eth/router.ts @@ -1,5 +1,5 @@ import type { Address, Hex, TransactionRequest } from 'viem'; -import { toHex, zeroAddress, numberToBytes, hexToBytes, bytesToHex, encodeFunctionData } from 'viem'; +import { toHex, zeroAddress, hexToBytes, bytesToHex, encodeFunctionData } from 'viem'; import { randomBytes } from '@noble/hashes/utils'; import { loadKZG } from 'kzg-wasm'; diff --git a/apis/vara-eth/test/setup/setup.ts b/apis/vara-eth/test/setup/setup.ts index b9e823addd..d461912f6e 100644 --- a/apis/vara-eth/test/setup/setup.ts +++ b/apis/vara-eth/test/setup/setup.ts @@ -1,7 +1,7 @@ import * as fs from 'fs'; import { config } from 'dotenv'; import { generateCodeHash } from '../../src/util/hash'; -import { execSync, spawn } from 'child_process'; +import { spawn } from 'child_process'; if (typeof WebSocket === 'undefined') { import('ws').then((module) => { @@ -13,11 +13,7 @@ config({ quiet: true }); const BLOCK_TIME = 1; const COUNTER_CODE = 'target/wasm32-gear/release/counter.opt.wasm'; -const ANVIL_RPC = 'ws://127.0.0.1:8545'; let routerAddress: string; -// Anvil default account #2 address, derived from the default mnemonic: -// "test test test test test test test test test test test junk" -const SENDER_ADDRESS = '0x3c44cdddb6a900fa2b585dd299e03d12fa4293bc'; let keyStore: string; const pathToEthexeBin = process.env.PATH_TO_ETHEXE!; From 72acfac59c8826e5d05a9ee621da593837f78192 Mon Sep 17 00:00:00 2001 From: StackOverflowExcept1on <109800286+StackOverflowExcept1on@users.noreply.github.com> Date: Tue, 31 Mar 2026 00:25:26 +0300 Subject: [PATCH 06/19] Revert "chore(deps): bump ethexe-common from `933a9b7` to `24b338b` in /apis/vara-eth (#2412)" This reverts commit 2bb1b88c4354336cb68dbab55bf570f9cee448c1. --- apis/vara-eth/Cargo.lock | 30 ++++++++++++++---------------- 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/apis/vara-eth/Cargo.lock b/apis/vara-eth/Cargo.lock index c8399d5d71..a0096ff899 100644 --- a/apis/vara-eth/Cargo.lock +++ b/apis/vara-eth/Cargo.lock @@ -1417,13 +1417,13 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb" dependencies = [ "libc", - "windows-sys 0.59.0", + "windows-sys 0.61.2", ] [[package]] name = "ethexe-common" version = "1.10.0" -source = "git+https://github.com/gear-tech/gear#ce5cfd53e0e1b13eedbb0cc18b1561d3fa0c212b" +source = "git+https://github.com/gear-tech/gear#933a9b74a82b30e2a32a278dfcac5f5fcb990ce0" dependencies = [ "alloy-primitives", "anyhow", @@ -1438,7 +1438,6 @@ dependencies = [ "nonempty", "parity-scale-codec", "roast-secp256k1-evm", - "scale-info", "serde", "sha3", "sp-core", @@ -1765,7 +1764,7 @@ dependencies = [ [[package]] name = "gear-core" version = "1.10.0" -source = "git+https://github.com/gear-tech/gear#ce5cfd53e0e1b13eedbb0cc18b1561d3fa0c212b" +source = "git+https://github.com/gear-tech/gear#933a9b74a82b30e2a32a278dfcac5f5fcb990ce0" dependencies = [ "blake2", "bytemuck", @@ -1809,7 +1808,7 @@ dependencies = [ [[package]] name = "gear-core-errors" version = "1.10.0" -source = "git+https://github.com/gear-tech/gear#ce5cfd53e0e1b13eedbb0cc18b1561d3fa0c212b" +source = "git+https://github.com/gear-tech/gear#933a9b74a82b30e2a32a278dfcac5f5fcb990ce0" dependencies = [ "enum-iterator", "gear-workspace-hack", @@ -1848,7 +1847,7 @@ dependencies = [ [[package]] name = "gear-ss58" version = "1.10.0" -source = "git+https://github.com/gear-tech/gear#ce5cfd53e0e1b13eedbb0cc18b1561d3fa0c212b" +source = "git+https://github.com/gear-tech/gear#933a9b74a82b30e2a32a278dfcac5f5fcb990ce0" dependencies = [ "blake2", "bs58", @@ -1899,7 +1898,7 @@ dependencies = [ [[package]] name = "gear-wasm-instrument" version = "1.10.0" -source = "git+https://github.com/gear-tech/gear#ce5cfd53e0e1b13eedbb0cc18b1561d3fa0c212b" +source = "git+https://github.com/gear-tech/gear#933a9b74a82b30e2a32a278dfcac5f5fcb990ce0" dependencies = [ "derive_more 2.1.1", "enum-iterator", @@ -2017,7 +2016,7 @@ dependencies = [ [[package]] name = "gprimitives" version = "1.10.0" -source = "git+https://github.com/gear-tech/gear#ce5cfd53e0e1b13eedbb0cc18b1561d3fa0c212b" +source = "git+https://github.com/gear-tech/gear#933a9b74a82b30e2a32a278dfcac5f5fcb990ce0" dependencies = [ "bytemuck", "derive_more 2.1.1", @@ -2046,7 +2045,7 @@ dependencies = [ [[package]] name = "gsigner" version = "1.10.0" -source = "git+https://github.com/gear-tech/gear#ce5cfd53e0e1b13eedbb0cc18b1561d3fa0c212b" +source = "git+https://github.com/gear-tech/gear#933a9b74a82b30e2a32a278dfcac5f5fcb990ce0" dependencies = [ "alloy-primitives", "anyhow", @@ -2060,7 +2059,6 @@ dependencies = [ "nacl", "parity-scale-codec", "rand 0.8.5", - "scale-info", "secrecy", "serde", "serde_json", @@ -2119,7 +2117,7 @@ dependencies = [ [[package]] name = "gsys" version = "1.10.0" -source = "git+https://github.com/gear-tech/gear#ce5cfd53e0e1b13eedbb0cc18b1561d3fa0c212b" +source = "git+https://github.com/gear-tech/gear#933a9b74a82b30e2a32a278dfcac5f5fcb990ce0" dependencies = [ "bytemuck", "gear-workspace-hack", @@ -2778,7 +2776,7 @@ version = "0.50.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7957b9740744892f114936ab4a57b3f487491bbeafaf8083688b16841a4240e5" dependencies = [ - "windows-sys 0.59.0", + "windows-sys 0.61.2", ] [[package]] @@ -2840,7 +2838,7 @@ dependencies = [ [[package]] name = "numerated" version = "1.10.0" -source = "git+https://github.com/gear-tech/gear#ce5cfd53e0e1b13eedbb0cc18b1561d3fa0c212b" +source = "git+https://github.com/gear-tech/gear#933a9b74a82b30e2a32a278dfcac5f5fcb990ce0" dependencies = [ "derive_more 2.1.1", "gear-workspace-hack", @@ -3564,7 +3562,7 @@ dependencies = [ "errno", "libc", "linux-raw-sys 0.12.1", - "windows-sys 0.59.0", + "windows-sys 0.61.2", ] [[package]] @@ -4463,7 +4461,7 @@ dependencies = [ "getrandom 0.4.1", "once_cell", "rustix 1.1.4", - "windows-sys 0.59.0", + "windows-sys 0.61.2", ] [[package]] @@ -5066,7 +5064,7 @@ version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c2a7b1c03c876122aa43f3020e6c3c3ee5c05081c9a00739faf7503aeba10d22" dependencies = [ - "windows-sys 0.59.0", + "windows-sys 0.61.2", ] [[package]] From 8af6d548833eedc318275cd0b02894afb60fce97 Mon Sep 17 00:00:00 2001 From: StackOverflowExcept1on <109800286+StackOverflowExcept1on@users.noreply.github.com> Date: Tue, 31 Mar 2026 11:38:23 +0300 Subject: [PATCH 07/19] fix serde features --- apis/vara-eth/Cargo.lock | 53 +++++++++++++-------- apis/vara-eth/Cargo.toml | 6 +-- apis/vara-eth/programs/injected/src/main.rs | 6 +-- 3 files changed, 39 insertions(+), 26 deletions(-) diff --git a/apis/vara-eth/Cargo.lock b/apis/vara-eth/Cargo.lock index a0096ff899..ab8e087f74 100644 --- a/apis/vara-eth/Cargo.lock +++ b/apis/vara-eth/Cargo.lock @@ -89,6 +89,7 @@ dependencies = [ "const-hex", "derive_more 2.1.1", "foldhash 0.2.0", + "hashbrown 0.16.1", "indexmap", "itoa", "k256", @@ -680,6 +681,9 @@ name = "bytes" version = "1.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1e748733b7cbc798e1434b6ac524f0c1ff2ab456fe201501e6497c8417a4fc33" +dependencies = [ + "serde", +] [[package]] name = "camino" @@ -1423,21 +1427,22 @@ dependencies = [ [[package]] name = "ethexe-common" version = "1.10.0" -source = "git+https://github.com/gear-tech/gear#933a9b74a82b30e2a32a278dfcac5f5fcb990ce0" +source = "git+https://github.com/gear-tech/gear?branch=av%2Fethexe-cli-configurable#fb6e31b1559768f613176c258eaf4eeceb84a9ff" dependencies = [ "alloy-primitives", "anyhow", "auto_impl", "derive_more 2.1.1", - "gear-core 1.10.0 (git+https://github.com/gear-tech/gear)", + "gear-core 1.10.0 (git+https://github.com/gear-tech/gear?branch=av%2Fethexe-cli-configurable)", "gear-workspace-hack", - "gprimitives 1.10.0 (git+https://github.com/gear-tech/gear)", + "gprimitives 1.10.0 (git+https://github.com/gear-tech/gear?branch=av%2Fethexe-cli-configurable)", "gsigner", "hex", "k256", "nonempty", "parity-scale-codec", "roast-secp256k1-evm", + "scale-info", "serde", "sha3", "sp-core", @@ -1764,23 +1769,23 @@ dependencies = [ [[package]] name = "gear-core" version = "1.10.0" -source = "git+https://github.com/gear-tech/gear#933a9b74a82b30e2a32a278dfcac5f5fcb990ce0" +source = "git+https://github.com/gear-tech/gear?branch=av%2Fethexe-cli-configurable#fb6e31b1559768f613176c258eaf4eeceb84a9ff" dependencies = [ "blake2", "bytemuck", "byteorder", "derive_more 2.1.1", "enum-iterator", - "gear-core-errors 1.10.0 (git+https://github.com/gear-tech/gear)", - "gear-wasm-instrument 1.10.0 (git+https://github.com/gear-tech/gear)", + "gear-core-errors 1.10.0 (git+https://github.com/gear-tech/gear?branch=av%2Fethexe-cli-configurable)", + "gear-wasm-instrument 1.10.0 (git+https://github.com/gear-tech/gear?branch=av%2Fethexe-cli-configurable)", "gear-workspace-hack", - "gprimitives 1.10.0 (git+https://github.com/gear-tech/gear)", - "gsys 1.10.0 (git+https://github.com/gear-tech/gear)", + "gprimitives 1.10.0 (git+https://github.com/gear-tech/gear?branch=av%2Fethexe-cli-configurable)", + "gsys 1.10.0 (git+https://github.com/gear-tech/gear?branch=av%2Fethexe-cli-configurable)", "hex", "impl-serde", "log", "num-traits", - "numerated 1.10.0 (git+https://github.com/gear-tech/gear)", + "numerated 1.10.0 (git+https://github.com/gear-tech/gear?branch=av%2Fethexe-cli-configurable)", "parity-scale-codec", "paste", "scale-decode", @@ -1808,7 +1813,7 @@ dependencies = [ [[package]] name = "gear-core-errors" version = "1.10.0" -source = "git+https://github.com/gear-tech/gear#933a9b74a82b30e2a32a278dfcac5f5fcb990ce0" +source = "git+https://github.com/gear-tech/gear?branch=av%2Fethexe-cli-configurable#fb6e31b1559768f613176c258eaf4eeceb84a9ff" dependencies = [ "enum-iterator", "gear-workspace-hack", @@ -1847,7 +1852,7 @@ dependencies = [ [[package]] name = "gear-ss58" version = "1.10.0" -source = "git+https://github.com/gear-tech/gear#933a9b74a82b30e2a32a278dfcac5f5fcb990ce0" +source = "git+https://github.com/gear-tech/gear?branch=av%2Fethexe-cli-configurable#fb6e31b1559768f613176c258eaf4eeceb84a9ff" dependencies = [ "blake2", "bs58", @@ -1898,7 +1903,7 @@ dependencies = [ [[package]] name = "gear-wasm-instrument" version = "1.10.0" -source = "git+https://github.com/gear-tech/gear#933a9b74a82b30e2a32a278dfcac5f5fcb990ce0" +source = "git+https://github.com/gear-tech/gear?branch=av%2Fethexe-cli-configurable#fb6e31b1559768f613176c258eaf4eeceb84a9ff" dependencies = [ "derive_more 2.1.1", "enum-iterator", @@ -2016,11 +2021,11 @@ dependencies = [ [[package]] name = "gprimitives" version = "1.10.0" -source = "git+https://github.com/gear-tech/gear#933a9b74a82b30e2a32a278dfcac5f5fcb990ce0" +source = "git+https://github.com/gear-tech/gear?branch=av%2Fethexe-cli-configurable#fb6e31b1559768f613176c258eaf4eeceb84a9ff" dependencies = [ "bytemuck", "derive_more 2.1.1", - "gear-ss58 1.10.0 (git+https://github.com/gear-tech/gear)", + "gear-ss58 1.10.0 (git+https://github.com/gear-tech/gear?branch=av%2Fethexe-cli-configurable)", "gear-workspace-hack", "hex", "primitive-types 0.12.2", @@ -2045,7 +2050,7 @@ dependencies = [ [[package]] name = "gsigner" version = "1.10.0" -source = "git+https://github.com/gear-tech/gear#933a9b74a82b30e2a32a278dfcac5f5fcb990ce0" +source = "git+https://github.com/gear-tech/gear?branch=av%2Fethexe-cli-configurable#fb6e31b1559768f613176c258eaf4eeceb84a9ff" dependencies = [ "alloy-primitives", "anyhow", @@ -2053,12 +2058,13 @@ dependencies = [ "derive_more 2.1.1", "dirs", "gear-workspace-hack", - "gprimitives 1.10.0 (git+https://github.com/gear-tech/gear)", + "gprimitives 1.10.0 (git+https://github.com/gear-tech/gear?branch=av%2Fethexe-cli-configurable)", "hex", "k256", "nacl", "parity-scale-codec", "rand 0.8.5", + "scale-info", "secrecy", "serde", "serde_json", @@ -2117,7 +2123,7 @@ dependencies = [ [[package]] name = "gsys" version = "1.10.0" -source = "git+https://github.com/gear-tech/gear#933a9b74a82b30e2a32a278dfcac5f5fcb990ce0" +source = "git+https://github.com/gear-tech/gear?branch=av%2Fethexe-cli-configurable#fb6e31b1559768f613176c258eaf4eeceb84a9ff" dependencies = [ "bytemuck", "gear-workspace-hack", @@ -2196,6 +2202,11 @@ name = "hashbrown" version = "0.16.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "841d1cc9bed7f9236f321df977030373f4a4163ae1a7dbfe1a51a2c1a51d9100" +dependencies = [ + "foldhash 0.2.0", + "serde", + "serde_core", +] [[package]] name = "heapless" @@ -2461,8 +2472,8 @@ name = "injected" version = "0.1.0" dependencies = [ "ethexe-common", - "gear-core 1.10.0 (git+https://github.com/gear-tech/gear)", - "gear-core-errors 1.10.0 (git+https://github.com/gear-tech/gear)", + "gear-core 1.10.0 (git+https://github.com/gear-tech/gear?branch=av%2Fethexe-cli-configurable)", + "gear-core-errors 1.10.0 (git+https://github.com/gear-tech/gear?branch=av%2Fethexe-cli-configurable)", "hex", ] @@ -2838,7 +2849,7 @@ dependencies = [ [[package]] name = "numerated" version = "1.10.0" -source = "git+https://github.com/gear-tech/gear#933a9b74a82b30e2a32a278dfcac5f5fcb990ce0" +source = "git+https://github.com/gear-tech/gear?branch=av%2Fethexe-cli-configurable#fb6e31b1559768f613176c258eaf4eeceb84a9ff" dependencies = [ "derive_more 2.1.1", "gear-workspace-hack", @@ -3294,6 +3305,7 @@ checksum = "6db2770f06117d490610c7488547d543617b21bfa07796d7a12f6f1bd53850d1" dependencies = [ "rand_chacha 0.9.0", "rand_core 0.9.5", + "serde", ] [[package]] @@ -3332,6 +3344,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "76afc826de14238e6e8c374ddcc1fa19e374fd8dd986b0d2af0d02377261d83c" dependencies = [ "getrandom 0.3.4", + "serde", ] [[package]] diff --git a/apis/vara-eth/Cargo.toml b/apis/vara-eth/Cargo.toml index 1a5596041d..f08dae87c5 100644 --- a/apis/vara-eth/Cargo.toml +++ b/apis/vara-eth/Cargo.toml @@ -11,7 +11,7 @@ members = ["programs/counter", "programs/counter-idl", "programs/injected"] [workspace.dependencies] sails-rs = "0.10.3" -ethexe-common = { git = "https://github.com/gear-tech/gear" } -gear-core = { git = "https://github.com/gear-tech/gear" } -gear-core-errors = { git = "https://github.com/gear-tech/gear" } +ethexe-common = { git = "https://github.com/gear-tech/gear", branch = "av/ethexe-cli-configurable" } +gear-core = { git = "https://github.com/gear-tech/gear", branch = "av/ethexe-cli-configurable" } +gear-core-errors = { git = "https://github.com/gear-tech/gear", branch = "av/ethexe-cli-configurable" } hex = "0.4" diff --git a/apis/vara-eth/programs/injected/src/main.rs b/apis/vara-eth/programs/injected/src/main.rs index 2a21d9c5c6..dcd91a7f81 100644 --- a/apis/vara-eth/programs/injected/src/main.rs +++ b/apis/vara-eth/programs/injected/src/main.rs @@ -1,8 +1,8 @@ use ethexe_common::{ + ToDigest, ecdsa::{PrivateKey, Signature, SignedMessage}, gprimitives::{ActorId, H256}, injected::{InjectedTransaction, Promise}, - ToDigest, }; use gear_core::rpc::ReplyInfo; use gear_core_errors::{ReplyCode, SuccessReplyReason}; @@ -15,10 +15,10 @@ pub fn main() { let tx = InjectedTransaction { destination: ActorId::zero(), - payload: Vec::from([0, 1, 2]).into(), + payload: Vec::from([0, 1, 2]).try_into().unwrap(), value: 256, reference_block: H256::zero(), - salt: Vec::from([3, 4, 5]).into(), + salt: Vec::from([3, 4, 5]).try_into().unwrap(), }; println!("hash: <{:?}>", tx.to_digest()); From 19a820bf17aac89ff9660ecdb0febb4b646a5456 Mon Sep 17 00:00:00 2001 From: StackOverflowExcept1on <109800286+StackOverflowExcept1on@users.noreply.github.com> Date: Tue, 31 Mar 2026 12:45:33 +0300 Subject: [PATCH 08/19] switch to gear master --- apis/vara-eth/Cargo.lock | 50 ++++++++++++++++++++-------------------- apis/vara-eth/Cargo.toml | 6 ++--- 2 files changed, 28 insertions(+), 28 deletions(-) diff --git a/apis/vara-eth/Cargo.lock b/apis/vara-eth/Cargo.lock index ab8e087f74..bc5b044c64 100644 --- a/apis/vara-eth/Cargo.lock +++ b/apis/vara-eth/Cargo.lock @@ -1421,21 +1421,21 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb" dependencies = [ "libc", - "windows-sys 0.61.2", + "windows-sys 0.59.0", ] [[package]] name = "ethexe-common" version = "1.10.0" -source = "git+https://github.com/gear-tech/gear?branch=av%2Fethexe-cli-configurable#fb6e31b1559768f613176c258eaf4eeceb84a9ff" +source = "git+https://github.com/gear-tech/gear#e82ef2dff7df95127d1a2cc0a728076a8392a1f9" dependencies = [ "alloy-primitives", "anyhow", "auto_impl", "derive_more 2.1.1", - "gear-core 1.10.0 (git+https://github.com/gear-tech/gear?branch=av%2Fethexe-cli-configurable)", + "gear-core 1.10.0 (git+https://github.com/gear-tech/gear)", "gear-workspace-hack", - "gprimitives 1.10.0 (git+https://github.com/gear-tech/gear?branch=av%2Fethexe-cli-configurable)", + "gprimitives 1.10.0 (git+https://github.com/gear-tech/gear)", "gsigner", "hex", "k256", @@ -1769,23 +1769,23 @@ dependencies = [ [[package]] name = "gear-core" version = "1.10.0" -source = "git+https://github.com/gear-tech/gear?branch=av%2Fethexe-cli-configurable#fb6e31b1559768f613176c258eaf4eeceb84a9ff" +source = "git+https://github.com/gear-tech/gear#e82ef2dff7df95127d1a2cc0a728076a8392a1f9" dependencies = [ "blake2", "bytemuck", "byteorder", "derive_more 2.1.1", "enum-iterator", - "gear-core-errors 1.10.0 (git+https://github.com/gear-tech/gear?branch=av%2Fethexe-cli-configurable)", - "gear-wasm-instrument 1.10.0 (git+https://github.com/gear-tech/gear?branch=av%2Fethexe-cli-configurable)", + "gear-core-errors 1.10.0 (git+https://github.com/gear-tech/gear)", + "gear-wasm-instrument 1.10.0 (git+https://github.com/gear-tech/gear)", "gear-workspace-hack", - "gprimitives 1.10.0 (git+https://github.com/gear-tech/gear?branch=av%2Fethexe-cli-configurable)", - "gsys 1.10.0 (git+https://github.com/gear-tech/gear?branch=av%2Fethexe-cli-configurable)", + "gprimitives 1.10.0 (git+https://github.com/gear-tech/gear)", + "gsys 1.10.0 (git+https://github.com/gear-tech/gear)", "hex", "impl-serde", "log", "num-traits", - "numerated 1.10.0 (git+https://github.com/gear-tech/gear?branch=av%2Fethexe-cli-configurable)", + "numerated 1.10.0 (git+https://github.com/gear-tech/gear)", "parity-scale-codec", "paste", "scale-decode", @@ -1813,7 +1813,7 @@ dependencies = [ [[package]] name = "gear-core-errors" version = "1.10.0" -source = "git+https://github.com/gear-tech/gear?branch=av%2Fethexe-cli-configurable#fb6e31b1559768f613176c258eaf4eeceb84a9ff" +source = "git+https://github.com/gear-tech/gear#e82ef2dff7df95127d1a2cc0a728076a8392a1f9" dependencies = [ "enum-iterator", "gear-workspace-hack", @@ -1852,7 +1852,7 @@ dependencies = [ [[package]] name = "gear-ss58" version = "1.10.0" -source = "git+https://github.com/gear-tech/gear?branch=av%2Fethexe-cli-configurable#fb6e31b1559768f613176c258eaf4eeceb84a9ff" +source = "git+https://github.com/gear-tech/gear#e82ef2dff7df95127d1a2cc0a728076a8392a1f9" dependencies = [ "blake2", "bs58", @@ -1903,7 +1903,7 @@ dependencies = [ [[package]] name = "gear-wasm-instrument" version = "1.10.0" -source = "git+https://github.com/gear-tech/gear?branch=av%2Fethexe-cli-configurable#fb6e31b1559768f613176c258eaf4eeceb84a9ff" +source = "git+https://github.com/gear-tech/gear#e82ef2dff7df95127d1a2cc0a728076a8392a1f9" dependencies = [ "derive_more 2.1.1", "enum-iterator", @@ -2021,11 +2021,11 @@ dependencies = [ [[package]] name = "gprimitives" version = "1.10.0" -source = "git+https://github.com/gear-tech/gear?branch=av%2Fethexe-cli-configurable#fb6e31b1559768f613176c258eaf4eeceb84a9ff" +source = "git+https://github.com/gear-tech/gear#e82ef2dff7df95127d1a2cc0a728076a8392a1f9" dependencies = [ "bytemuck", "derive_more 2.1.1", - "gear-ss58 1.10.0 (git+https://github.com/gear-tech/gear?branch=av%2Fethexe-cli-configurable)", + "gear-ss58 1.10.0 (git+https://github.com/gear-tech/gear)", "gear-workspace-hack", "hex", "primitive-types 0.12.2", @@ -2050,7 +2050,7 @@ dependencies = [ [[package]] name = "gsigner" version = "1.10.0" -source = "git+https://github.com/gear-tech/gear?branch=av%2Fethexe-cli-configurable#fb6e31b1559768f613176c258eaf4eeceb84a9ff" +source = "git+https://github.com/gear-tech/gear#e82ef2dff7df95127d1a2cc0a728076a8392a1f9" dependencies = [ "alloy-primitives", "anyhow", @@ -2058,7 +2058,7 @@ dependencies = [ "derive_more 2.1.1", "dirs", "gear-workspace-hack", - "gprimitives 1.10.0 (git+https://github.com/gear-tech/gear?branch=av%2Fethexe-cli-configurable)", + "gprimitives 1.10.0 (git+https://github.com/gear-tech/gear)", "hex", "k256", "nacl", @@ -2123,7 +2123,7 @@ dependencies = [ [[package]] name = "gsys" version = "1.10.0" -source = "git+https://github.com/gear-tech/gear?branch=av%2Fethexe-cli-configurable#fb6e31b1559768f613176c258eaf4eeceb84a9ff" +source = "git+https://github.com/gear-tech/gear#e82ef2dff7df95127d1a2cc0a728076a8392a1f9" dependencies = [ "bytemuck", "gear-workspace-hack", @@ -2472,8 +2472,8 @@ name = "injected" version = "0.1.0" dependencies = [ "ethexe-common", - "gear-core 1.10.0 (git+https://github.com/gear-tech/gear?branch=av%2Fethexe-cli-configurable)", - "gear-core-errors 1.10.0 (git+https://github.com/gear-tech/gear?branch=av%2Fethexe-cli-configurable)", + "gear-core 1.10.0 (git+https://github.com/gear-tech/gear)", + "gear-core-errors 1.10.0 (git+https://github.com/gear-tech/gear)", "hex", ] @@ -2787,7 +2787,7 @@ version = "0.50.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7957b9740744892f114936ab4a57b3f487491bbeafaf8083688b16841a4240e5" dependencies = [ - "windows-sys 0.61.2", + "windows-sys 0.59.0", ] [[package]] @@ -2849,7 +2849,7 @@ dependencies = [ [[package]] name = "numerated" version = "1.10.0" -source = "git+https://github.com/gear-tech/gear?branch=av%2Fethexe-cli-configurable#fb6e31b1559768f613176c258eaf4eeceb84a9ff" +source = "git+https://github.com/gear-tech/gear#e82ef2dff7df95127d1a2cc0a728076a8392a1f9" dependencies = [ "derive_more 2.1.1", "gear-workspace-hack", @@ -3575,7 +3575,7 @@ dependencies = [ "errno", "libc", "linux-raw-sys 0.12.1", - "windows-sys 0.61.2", + "windows-sys 0.59.0", ] [[package]] @@ -4474,7 +4474,7 @@ dependencies = [ "getrandom 0.4.1", "once_cell", "rustix 1.1.4", - "windows-sys 0.61.2", + "windows-sys 0.59.0", ] [[package]] @@ -5077,7 +5077,7 @@ version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c2a7b1c03c876122aa43f3020e6c3c3ee5c05081c9a00739faf7503aeba10d22" dependencies = [ - "windows-sys 0.61.2", + "windows-sys 0.59.0", ] [[package]] diff --git a/apis/vara-eth/Cargo.toml b/apis/vara-eth/Cargo.toml index f08dae87c5..1a5596041d 100644 --- a/apis/vara-eth/Cargo.toml +++ b/apis/vara-eth/Cargo.toml @@ -11,7 +11,7 @@ members = ["programs/counter", "programs/counter-idl", "programs/injected"] [workspace.dependencies] sails-rs = "0.10.3" -ethexe-common = { git = "https://github.com/gear-tech/gear", branch = "av/ethexe-cli-configurable" } -gear-core = { git = "https://github.com/gear-tech/gear", branch = "av/ethexe-cli-configurable" } -gear-core-errors = { git = "https://github.com/gear-tech/gear", branch = "av/ethexe-cli-configurable" } +ethexe-common = { git = "https://github.com/gear-tech/gear" } +gear-core = { git = "https://github.com/gear-tech/gear" } +gear-core-errors = { git = "https://github.com/gear-tech/gear" } hex = "0.4" From 227dfac699f89407ebdadd2d8685c69d4c8a1d85 Mon Sep 17 00:00:00 2001 From: StackOverflowExcept1on <109800286+StackOverflowExcept1on@users.noreply.github.com> Date: Tue, 31 Mar 2026 14:28:00 +0300 Subject: [PATCH 09/19] fix some nits --- apis/vara-eth/contracts/Counter.sol | 2 +- apis/vara-eth/src/eth/router.ts | 9 +++------ 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/apis/vara-eth/contracts/Counter.sol b/apis/vara-eth/contracts/Counter.sol index 45d37e95d8..2f69a62c9b 100644 --- a/apis/vara-eth/contracts/Counter.sol +++ b/apis/vara-eth/contracts/Counter.sol @@ -53,7 +53,7 @@ contract CounterCaller is ICounterCallbacks { _; } - function _onlyVaraEthProgram() internal { + function _onlyVaraEthProgram() internal view { if (msg.sender != address(VAR_ETH_PROGRAM)) { revert UnauthorizedCaller(); } diff --git a/apis/vara-eth/src/eth/router.ts b/apis/vara-eth/src/eth/router.ts index 1cf1874ef5..db987d79b2 100644 --- a/apis/vara-eth/src/eth/router.ts +++ b/apis/vara-eth/src/eth/router.ts @@ -262,9 +262,7 @@ export class RouterClient extends BaseContractClient implements IRouterContract chain: null, }; - const request = await this._pc.prepareTransactionRequest(tx); - - console.log(request); + await this._pc.prepareTransactionRequest(tx); const txManager: ITxManager = new TxManager(this._pc, this._signer!, tx, IROUTER_ABI, undefined, { codeId, @@ -277,7 +275,6 @@ export class RouterClient extends BaseContractClient implements IRouterContract eventName: 'CodeGotValidated', onLogs: (logs) => { for (const log of logs) { - console.log(log); if (log.args.codeId == codeId) { if (log.args.valid) { resolve(true); @@ -386,7 +383,7 @@ const FIELD_ELEMENTS_PER_BLOB = 4096; const FE_BYTES = 32; const USABLE_BYTES_PER_FE = 31; -export function simpleSidecarEncode(data: Uint8Array): Uint8Array[] { +function simpleSidecarEncode(data: Uint8Array): Uint8Array[] { const blobs: Uint8Array[] = []; let feCount = 0; @@ -426,4 +423,4 @@ export function simpleSidecarEncode(data: Uint8Array): Uint8Array[] { } return blobs; -} \ No newline at end of file +} From 83ed58ba2cbb923b1ade19a2ec9beb634cd981f6 Mon Sep 17 00:00:00 2001 From: Dmitri Osipov Date: Tue, 31 Mar 2026 16:28:45 +0200 Subject: [PATCH 10/19] update viem dependency --- apis/vara-eth/package.json | 2 +- idea/vara-eth/frontend/package.json | 2 +- idea/vara-eth/indexer/package.json | 2 +- yarn.lock | 27 ++++++++++++++++++++++++--- 4 files changed, 27 insertions(+), 6 deletions(-) diff --git a/apis/vara-eth/package.json b/apis/vara-eth/package.json index 444d8c5f31..3dc85f7569 100644 --- a/apis/vara-eth/package.json +++ b/apis/vara-eth/package.json @@ -44,7 +44,7 @@ "devDependencies": { "@types/ws": "8.18.1", "kzg-wasm": "1.0.0", - "viem": "https://pkg.pr.new/StackOverflowExcept1on/viem/viem@98e8516", + "viem": "npm:@vara-eth/viem@2.47.6", "ws": "8.18.3" }, "files": [ diff --git a/idea/vara-eth/frontend/package.json b/idea/vara-eth/frontend/package.json index 9149570155..5b1f4e5f13 100644 --- a/idea/vara-eth/frontend/package.json +++ b/idea/vara-eth/frontend/package.json @@ -26,7 +26,7 @@ "react-syntax-highlighter": "15.6.6", "sails-js": "0.5.1", "sails-js-parser": "0.5.1", - "viem": "https://pkg.pr.new/StackOverflowExcept1on/viem/viem@98e8516", + "viem": "npm:@vara-eth/viem@2.47.6", "wagmi": "2.19.4", "zod": "4.3.6" }, diff --git a/idea/vara-eth/indexer/package.json b/idea/vara-eth/indexer/package.json index a2099f80a0..5c21dd56b7 100644 --- a/idea/vara-eth/indexer/package.json +++ b/idea/vara-eth/indexer/package.json @@ -36,7 +36,7 @@ "reflect-metadata": "^0.2.2", "rxjs": "^7.8.2", "typeorm": "0.3.28", - "viem": "https://pkg.pr.new/StackOverflowExcept1on/viem/viem@98e8516", + "viem": "npm:@vara-eth/viem@2.47.6", "xxhash-addon": "^2.0.3" }, "devDependencies": { diff --git a/yarn.lock b/yarn.lock index 3022362703..66d8fcb7b9 100644 --- a/yarn.lock +++ b/yarn.lock @@ -10429,7 +10429,7 @@ __metadata: "@noble/hashes": "npm:1.8.0" "@types/ws": "npm:8.18.1" kzg-wasm: "npm:1.0.0" - viem: "https://pkg.pr.new/StackOverflowExcept1on/viem/viem@98e8516" + viem: "npm:@vara-eth/viem@2.47.6" ws: "npm:8.18.3" peerDependencies: kzg-wasm: 1.0.0 @@ -25767,7 +25767,7 @@ __metadata: react-syntax-highlighter: "npm:15.6.6" sails-js: "npm:0.5.1" sails-js-parser: "npm:0.5.1" - viem: "https://pkg.pr.new/StackOverflowExcept1on/viem/viem@98e8516" + viem: "npm:@vara-eth/viem@2.47.6" wagmi: "npm:2.19.4" zod: "npm:4.3.6" languageName: unknown @@ -25801,7 +25801,7 @@ __metadata: reflect-metadata: "npm:^0.2.2" rxjs: "npm:^7.8.2" typeorm: "npm:0.3.28" - viem: "https://pkg.pr.new/StackOverflowExcept1on/viem/viem@98e8516" + viem: "npm:@vara-eth/viem@2.47.6" xxhash-addon: "npm:^2.0.3" languageName: unknown linkType: soft @@ -25876,6 +25876,27 @@ __metadata: languageName: node linkType: hard +"viem@npm:@vara-eth/viem@2.47.6": + version: 2.47.6 + resolution: "@vara-eth/viem@npm:2.47.6" + dependencies: + "@noble/curves": "npm:1.9.1" + "@noble/hashes": "npm:1.8.0" + "@scure/bip32": "npm:1.7.0" + "@scure/bip39": "npm:1.6.0" + abitype: "npm:1.2.3" + isows: "npm:1.0.7" + ox: "npm:0.14.7" + ws: "npm:8.18.3" + peerDependencies: + typescript: ">=5.0.4" + peerDependenciesMeta: + typescript: + optional: true + checksum: 10c0/3c71f8c9feaaf12608949e7a48947815b7d9e28d1f9dd326a53389d004ad930e7e6f13d8e656f0d3df0c70656c71f8e3e88dc3b5ed5237ecec963180e6c2e046 + languageName: node + linkType: hard + "vite-plugin-checker@npm:0.12.0": version: 0.12.0 resolution: "vite-plugin-checker@npm:0.12.0" From 590c5bda05d3c8b17b71f8b7c939c8a15fb0b4e8 Mon Sep 17 00:00:00 2001 From: StackOverflowExcept1on <109800286+StackOverflowExcept1on@users.noreply.github.com> Date: Tue, 31 Mar 2026 18:30:17 +0300 Subject: [PATCH 11/19] fix all places with viem fork --- apis/vara-eth/README.md | 2 +- idea/gear/faucet/package.json | 2 +- yarn.lock | 23 +---------------------- 3 files changed, 3 insertions(+), 24 deletions(-) diff --git a/apis/vara-eth/README.md b/apis/vara-eth/README.md index 43865cbd7b..8a35bbf0fb 100644 --- a/apis/vara-eth/README.md +++ b/apis/vara-eth/README.md @@ -46,7 +46,7 @@ npm install @vara-eth/api Install required peer dependencies: ```bash -npm install viem@^2.39.0 kzg-wasm@1.0.0 +npm install viem@npm:@vara-eth/viem@2.47.6 kzg-wasm@1.0.0 ``` ## Quick Start diff --git a/idea/gear/faucet/package.json b/idea/gear/faucet/package.json index 784dd95b1e..0a433f17bc 100644 --- a/idea/gear/faucet/package.json +++ b/idea/gear/faucet/package.json @@ -27,7 +27,7 @@ "reflect-metadata": "0.2.2", "swagger-ui-express": "5.0.1", "typeorm": "0.3.28", - "viem": "https://pkg.pr.new/StackOverflowExcept1on/viem/viem@98e8516", + "viem": "npm:@vara-eth/viem@2.47.6", "winston": "3.19.0", "xxhashjs": "0.2.2", "yamljs": "0.3.0" diff --git a/yarn.lock b/yarn.lock index 66d8fcb7b9..88ad53ad5b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -16271,7 +16271,7 @@ __metadata: supertest: "npm:^7.1.4" swagger-ui-express: "npm:5.0.1" typeorm: "npm:0.3.28" - viem: "https://pkg.pr.new/StackOverflowExcept1on/viem/viem@98e8516" + viem: "npm:@vara-eth/viem@2.47.6" winston: "npm:3.19.0" xxhashjs: "npm:0.2.2" yamljs: "npm:0.3.0" @@ -25813,27 +25813,6 @@ __metadata: languageName: node linkType: hard -"viem@https://pkg.pr.new/StackOverflowExcept1on/viem/viem@98e8516": - version: 2.47.7-98e8516.0 - resolution: "viem@https://pkg.pr.new/StackOverflowExcept1on/viem/viem@98e8516" - dependencies: - "@noble/curves": "npm:1.9.1" - "@noble/hashes": "npm:1.8.0" - "@scure/bip32": "npm:1.7.0" - "@scure/bip39": "npm:1.6.0" - abitype: "npm:1.2.3" - isows: "npm:1.0.7" - ox: "npm:0.14.7" - ws: "npm:8.18.3" - peerDependencies: - typescript: ">=5.0.4" - peerDependenciesMeta: - typescript: - optional: true - checksum: 10c0/00343320da047babb7697ea2aab7f94c302f2762ba9d2d3f322933b4fd7eb2fe9986dea3f22cf6632b2a8bde6417399bde7e6f0a05b0120bf67ab0783e9d398a - languageName: node - linkType: hard - "viem@npm:2.23.2": version: 2.23.2 resolution: "viem@npm:2.23.2" From 6e83d01930d702830964e4cd9a4ceb1aece41deb Mon Sep 17 00:00:00 2001 From: StackOverflowExcept1on <109800286+StackOverflowExcept1on@users.noreply.github.com> Date: Wed, 1 Apr 2026 14:16:52 +0300 Subject: [PATCH 12/19] fix fee --- apis/vara-eth/package.json | 2 +- apis/vara-eth/src/eth/router.ts | 17 ++++++++-- idea/gear/faucet/package.json | 2 +- idea/vara-eth/frontend/package.json | 2 +- idea/vara-eth/indexer/package.json | 2 +- yarn.lock | 50 ++++++++++++++--------------- 6 files changed, 43 insertions(+), 32 deletions(-) diff --git a/apis/vara-eth/package.json b/apis/vara-eth/package.json index 3dc85f7569..89016bf50f 100644 --- a/apis/vara-eth/package.json +++ b/apis/vara-eth/package.json @@ -44,7 +44,7 @@ "devDependencies": { "@types/ws": "8.18.1", "kzg-wasm": "1.0.0", - "viem": "npm:@vara-eth/viem@2.47.6", + "viem": "https://pkg.pr.new/StackOverflowExcept1on/viem/viem@d7d28b6", "ws": "8.18.3" }, "files": [ diff --git a/apis/vara-eth/src/eth/router.ts b/apis/vara-eth/src/eth/router.ts index db987d79b2..e1f74757ba 100644 --- a/apis/vara-eth/src/eth/router.ts +++ b/apis/vara-eth/src/eth/router.ts @@ -237,13 +237,22 @@ export class RouterClient extends BaseContractClient implements IRouterContract const blobs = simpleSidecarEncode(code); const kzg = await loadKZG(); + const feeHistory = await this._pc.getFeeHistory({ + blockCount: 2, + rewardPercentiles: [], + blockTag: 'latest', + }); + + const baseFeePerBlobGas = feeHistory.baseFeePerBlobGas!.at(-1) ?? 0n; + const maxFeePerBlobGas = baseFeePerBlobGas * 3n; + const tx = { type: 'eip4844' as const, blobVersion: '7594' as const, data, to: this.address, - gas: 5_000_000n, - maxFeePerBlobGas: 400_000_000_000n, + gas: 100_000n, + maxFeePerBlobGas, blobs, kzg: { blobToKzgCommitment: (blob: Uint8Array) => { @@ -255,13 +264,15 @@ export class RouterClient extends BaseContractClient implements IRouterContract return hexToBytes(result); }, computeCellsAndKzgProofs: (blob: Uint8Array): [Uint8Array[], Uint8Array[]] => { - const [cells, proofs] = kzg.computeCellsAndProofs(bytesToHex(blob)) as [`0x${string}`[], `0x${string}`[]]; + const [cells, proofs] = kzg.computeCellsAndProofs(bytesToHex(blob)) as [Hex[], Hex[]]; return [cells.map((cell) => hexToBytes(cell)), proofs.map((proof) => hexToBytes(proof))]; }, }, chain: null, }; + tx.gas = await this._pc.estimateGas(tx); + await this._pc.prepareTransactionRequest(tx); const txManager: ITxManager = new TxManager(this._pc, this._signer!, tx, IROUTER_ABI, undefined, { diff --git a/idea/gear/faucet/package.json b/idea/gear/faucet/package.json index bccd05f5b9..73fbb22811 100644 --- a/idea/gear/faucet/package.json +++ b/idea/gear/faucet/package.json @@ -27,7 +27,7 @@ "reflect-metadata": "0.2.2", "swagger-ui-express": "5.0.1", "typeorm": "0.3.28", - "viem": "npm:@vara-eth/viem@2.47.6", + "viem": "https://pkg.pr.new/StackOverflowExcept1on/viem/viem@d7d28b6", "winston": "3.19.0", "xxhashjs": "0.2.2", "yamljs": "0.3.0" diff --git a/idea/vara-eth/frontend/package.json b/idea/vara-eth/frontend/package.json index 5b1f4e5f13..a02b764e44 100644 --- a/idea/vara-eth/frontend/package.json +++ b/idea/vara-eth/frontend/package.json @@ -26,7 +26,7 @@ "react-syntax-highlighter": "15.6.6", "sails-js": "0.5.1", "sails-js-parser": "0.5.1", - "viem": "npm:@vara-eth/viem@2.47.6", + "viem": "https://pkg.pr.new/StackOverflowExcept1on/viem/viem@d7d28b6", "wagmi": "2.19.4", "zod": "4.3.6" }, diff --git a/idea/vara-eth/indexer/package.json b/idea/vara-eth/indexer/package.json index 5c21dd56b7..d8831c17fb 100644 --- a/idea/vara-eth/indexer/package.json +++ b/idea/vara-eth/indexer/package.json @@ -36,7 +36,7 @@ "reflect-metadata": "^0.2.2", "rxjs": "^7.8.2", "typeorm": "0.3.28", - "viem": "npm:@vara-eth/viem@2.47.6", + "viem": "https://pkg.pr.new/StackOverflowExcept1on/viem/viem@d7d28b6", "xxhash-addon": "^2.0.3" }, "devDependencies": { diff --git a/yarn.lock b/yarn.lock index 3527f54cd4..c6df096845 100644 --- a/yarn.lock +++ b/yarn.lock @@ -10429,7 +10429,7 @@ __metadata: "@noble/hashes": "npm:1.8.0" "@types/ws": "npm:8.18.1" kzg-wasm: "npm:1.0.0" - viem: "npm:@vara-eth/viem@2.47.6" + viem: "https://pkg.pr.new/StackOverflowExcept1on/viem/viem@d7d28b6" ws: "npm:8.18.3" peerDependencies: kzg-wasm: 1.0.0 @@ -16271,7 +16271,7 @@ __metadata: supertest: "npm:^7.1.4" swagger-ui-express: "npm:5.0.1" typeorm: "npm:0.3.28" - viem: "npm:@vara-eth/viem@2.47.6" + viem: "https://pkg.pr.new/StackOverflowExcept1on/viem/viem@d7d28b6" winston: "npm:3.19.0" xxhashjs: "npm:0.2.2" yamljs: "npm:0.3.0" @@ -25767,7 +25767,7 @@ __metadata: react-syntax-highlighter: "npm:15.6.6" sails-js: "npm:0.5.1" sails-js-parser: "npm:0.5.1" - viem: "npm:@vara-eth/viem@2.47.6" + viem: "https://pkg.pr.new/StackOverflowExcept1on/viem/viem@d7d28b6" wagmi: "npm:2.19.4" zod: "npm:4.3.6" languageName: unknown @@ -25801,7 +25801,7 @@ __metadata: reflect-metadata: "npm:^0.2.2" rxjs: "npm:^7.8.2" typeorm: "npm:0.3.28" - viem: "npm:@vara-eth/viem@2.47.6" + viem: "https://pkg.pr.new/StackOverflowExcept1on/viem/viem@d7d28b6" xxhash-addon: "npm:^2.0.3" languageName: unknown linkType: soft @@ -25813,6 +25813,27 @@ __metadata: languageName: node linkType: hard +"viem@https://pkg.pr.new/StackOverflowExcept1on/viem/viem@d7d28b6": + version: 2.47.8-d7d28b6.0 + resolution: "viem@https://pkg.pr.new/StackOverflowExcept1on/viem/viem@d7d28b6" + dependencies: + "@noble/curves": "npm:1.9.1" + "@noble/hashes": "npm:1.8.0" + "@scure/bip32": "npm:1.7.0" + "@scure/bip39": "npm:1.6.0" + abitype: "npm:1.2.3" + isows: "npm:1.0.7" + ox: "npm:0.14.7" + ws: "npm:8.18.3" + peerDependencies: + typescript: ">=5.0.4" + peerDependenciesMeta: + typescript: + optional: true + checksum: 10c0/35c539bb734c97845d7972d184b5a800f217d1b98494fcd78bbf71367c4d27cbc9bcc3027673d46b1af85f5581db2a5620be0ed9c36a0893d460478e88da0dde + languageName: node + linkType: hard + "viem@npm:2.23.2": version: 2.23.2 resolution: "viem@npm:2.23.2" @@ -25855,27 +25876,6 @@ __metadata: languageName: node linkType: hard -"viem@npm:@vara-eth/viem@2.47.6": - version: 2.47.6 - resolution: "@vara-eth/viem@npm:2.47.6" - dependencies: - "@noble/curves": "npm:1.9.1" - "@noble/hashes": "npm:1.8.0" - "@scure/bip32": "npm:1.7.0" - "@scure/bip39": "npm:1.6.0" - abitype: "npm:1.2.3" - isows: "npm:1.0.7" - ox: "npm:0.14.7" - ws: "npm:8.18.3" - peerDependencies: - typescript: ">=5.0.4" - peerDependenciesMeta: - typescript: - optional: true - checksum: 10c0/3c71f8c9feaaf12608949e7a48947815b7d9e28d1f9dd326a53389d004ad930e7e6f13d8e656f0d3df0c70656c71f8e3e88dc3b5ed5237ecec963180e6c2e046 - languageName: node - linkType: hard - "vite-plugin-checker@npm:0.12.0": version: 0.12.0 resolution: "vite-plugin-checker@npm:0.12.0" From 188d8039c007421218ff4894eab0cabf65fffcb9 Mon Sep 17 00:00:00 2001 From: Dmitri Osipov Date: Wed, 1 Apr 2026 13:30:48 +0200 Subject: [PATCH 13/19] update viem dependency --- apis/vara-eth/README.md | 2 +- apis/vara-eth/package.json | 2 +- idea/gear/faucet/package.json | 2 +- idea/vara-eth/frontend/package.json | 2 +- idea/vara-eth/indexer/package.json | 2 +- yarn.lock | 50 ++++++++++++++--------------- 6 files changed, 30 insertions(+), 30 deletions(-) diff --git a/apis/vara-eth/README.md b/apis/vara-eth/README.md index 8a35bbf0fb..063c26e774 100644 --- a/apis/vara-eth/README.md +++ b/apis/vara-eth/README.md @@ -46,7 +46,7 @@ npm install @vara-eth/api Install required peer dependencies: ```bash -npm install viem@npm:@vara-eth/viem@2.47.6 kzg-wasm@1.0.0 +npm install viem@npm:@vara-eth/viem@2.47.7 kzg-wasm@1.0.0 ``` ## Quick Start diff --git a/apis/vara-eth/package.json b/apis/vara-eth/package.json index 89016bf50f..6a70692574 100644 --- a/apis/vara-eth/package.json +++ b/apis/vara-eth/package.json @@ -44,7 +44,7 @@ "devDependencies": { "@types/ws": "8.18.1", "kzg-wasm": "1.0.0", - "viem": "https://pkg.pr.new/StackOverflowExcept1on/viem/viem@d7d28b6", + "viem": "npm:@vara-eth/viem@2.47.7", "ws": "8.18.3" }, "files": [ diff --git a/idea/gear/faucet/package.json b/idea/gear/faucet/package.json index 73fbb22811..45cde7059e 100644 --- a/idea/gear/faucet/package.json +++ b/idea/gear/faucet/package.json @@ -27,7 +27,7 @@ "reflect-metadata": "0.2.2", "swagger-ui-express": "5.0.1", "typeorm": "0.3.28", - "viem": "https://pkg.pr.new/StackOverflowExcept1on/viem/viem@d7d28b6", + "viem": "npm:@vara-eth/viem@2.47.7", "winston": "3.19.0", "xxhashjs": "0.2.2", "yamljs": "0.3.0" diff --git a/idea/vara-eth/frontend/package.json b/idea/vara-eth/frontend/package.json index a02b764e44..fbd4314fe1 100644 --- a/idea/vara-eth/frontend/package.json +++ b/idea/vara-eth/frontend/package.json @@ -26,7 +26,7 @@ "react-syntax-highlighter": "15.6.6", "sails-js": "0.5.1", "sails-js-parser": "0.5.1", - "viem": "https://pkg.pr.new/StackOverflowExcept1on/viem/viem@d7d28b6", + "viem": "npm:@vara-eth/viem@2.47.7", "wagmi": "2.19.4", "zod": "4.3.6" }, diff --git a/idea/vara-eth/indexer/package.json b/idea/vara-eth/indexer/package.json index d8831c17fb..8845179921 100644 --- a/idea/vara-eth/indexer/package.json +++ b/idea/vara-eth/indexer/package.json @@ -36,7 +36,7 @@ "reflect-metadata": "^0.2.2", "rxjs": "^7.8.2", "typeorm": "0.3.28", - "viem": "https://pkg.pr.new/StackOverflowExcept1on/viem/viem@d7d28b6", + "viem": "npm:@vara-eth/viem@2.47.7", "xxhash-addon": "^2.0.3" }, "devDependencies": { diff --git a/yarn.lock b/yarn.lock index c6df096845..eee26afdc5 100644 --- a/yarn.lock +++ b/yarn.lock @@ -10429,7 +10429,7 @@ __metadata: "@noble/hashes": "npm:1.8.0" "@types/ws": "npm:8.18.1" kzg-wasm: "npm:1.0.0" - viem: "https://pkg.pr.new/StackOverflowExcept1on/viem/viem@d7d28b6" + viem: "npm:@vara-eth/viem@2.47.7" ws: "npm:8.18.3" peerDependencies: kzg-wasm: 1.0.0 @@ -16271,7 +16271,7 @@ __metadata: supertest: "npm:^7.1.4" swagger-ui-express: "npm:5.0.1" typeorm: "npm:0.3.28" - viem: "https://pkg.pr.new/StackOverflowExcept1on/viem/viem@d7d28b6" + viem: "npm:@vara-eth/viem@2.47.7" winston: "npm:3.19.0" xxhashjs: "npm:0.2.2" yamljs: "npm:0.3.0" @@ -25767,7 +25767,7 @@ __metadata: react-syntax-highlighter: "npm:15.6.6" sails-js: "npm:0.5.1" sails-js-parser: "npm:0.5.1" - viem: "https://pkg.pr.new/StackOverflowExcept1on/viem/viem@d7d28b6" + viem: "npm:@vara-eth/viem@2.47.7" wagmi: "npm:2.19.4" zod: "npm:4.3.6" languageName: unknown @@ -25801,7 +25801,7 @@ __metadata: reflect-metadata: "npm:^0.2.2" rxjs: "npm:^7.8.2" typeorm: "npm:0.3.28" - viem: "https://pkg.pr.new/StackOverflowExcept1on/viem/viem@d7d28b6" + viem: "npm:@vara-eth/viem@2.47.7" xxhash-addon: "npm:^2.0.3" languageName: unknown linkType: soft @@ -25813,27 +25813,6 @@ __metadata: languageName: node linkType: hard -"viem@https://pkg.pr.new/StackOverflowExcept1on/viem/viem@d7d28b6": - version: 2.47.8-d7d28b6.0 - resolution: "viem@https://pkg.pr.new/StackOverflowExcept1on/viem/viem@d7d28b6" - dependencies: - "@noble/curves": "npm:1.9.1" - "@noble/hashes": "npm:1.8.0" - "@scure/bip32": "npm:1.7.0" - "@scure/bip39": "npm:1.6.0" - abitype: "npm:1.2.3" - isows: "npm:1.0.7" - ox: "npm:0.14.7" - ws: "npm:8.18.3" - peerDependencies: - typescript: ">=5.0.4" - peerDependenciesMeta: - typescript: - optional: true - checksum: 10c0/35c539bb734c97845d7972d184b5a800f217d1b98494fcd78bbf71367c4d27cbc9bcc3027673d46b1af85f5581db2a5620be0ed9c36a0893d460478e88da0dde - languageName: node - linkType: hard - "viem@npm:2.23.2": version: 2.23.2 resolution: "viem@npm:2.23.2" @@ -25876,6 +25855,27 @@ __metadata: languageName: node linkType: hard +"viem@npm:@vara-eth/viem@2.47.7": + version: 2.47.7 + resolution: "@vara-eth/viem@npm:2.47.7" + dependencies: + "@noble/curves": "npm:1.9.1" + "@noble/hashes": "npm:1.8.0" + "@scure/bip32": "npm:1.7.0" + "@scure/bip39": "npm:1.6.0" + abitype: "npm:1.2.3" + isows: "npm:1.0.7" + ox: "npm:0.14.7" + ws: "npm:8.18.3" + peerDependencies: + typescript: ">=5.0.4" + peerDependenciesMeta: + typescript: + optional: true + checksum: 10c0/939955e6b6b9d078cd1c09c53b29f3093303243ccaf3dbae2f50b2fb5447e019759d30f9dff2384af93748c624b97f1833d41e6a242f4f2ab1e5a2caf5fc4732 + languageName: node + linkType: hard + "vite-plugin-checker@npm:0.12.0": version: 0.12.0 resolution: "vite-plugin-checker@npm:0.12.0" From 9b1330e6d9f556d8be2ea2658543f3e6b3551dc8 Mon Sep 17 00:00:00 2001 From: StackOverflowExcept1on <109800286+StackOverflowExcept1on@users.noreply.github.com> Date: Wed, 1 Apr 2026 14:43:05 +0300 Subject: [PATCH 14/19] fix undefined --- apis/vara-eth/src/eth/router.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apis/vara-eth/src/eth/router.ts b/apis/vara-eth/src/eth/router.ts index e1f74757ba..c21ff24f6f 100644 --- a/apis/vara-eth/src/eth/router.ts +++ b/apis/vara-eth/src/eth/router.ts @@ -243,7 +243,7 @@ export class RouterClient extends BaseContractClient implements IRouterContract blockTag: 'latest', }); - const baseFeePerBlobGas = feeHistory.baseFeePerBlobGas!.at(-1) ?? 0n; + const baseFeePerBlobGas = (feeHistory.baseFeePerBlobGas ?? []).at(-1) ?? 1n; const maxFeePerBlobGas = baseFeePerBlobGas * 3n; const tx = { From f5ed4b374b1095bc3bed863ba8961af88dd27ccb Mon Sep 17 00:00:00 2001 From: StackOverflowExcept1on <109800286+StackOverflowExcept1on@users.noreply.github.com> Date: Wed, 1 Apr 2026 15:03:05 +0300 Subject: [PATCH 15/19] console log fee --- apis/vara-eth/src/eth/router.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/apis/vara-eth/src/eth/router.ts b/apis/vara-eth/src/eth/router.ts index c21ff24f6f..62d30a8bfc 100644 --- a/apis/vara-eth/src/eth/router.ts +++ b/apis/vara-eth/src/eth/router.ts @@ -242,6 +242,7 @@ export class RouterClient extends BaseContractClient implements IRouterContract rewardPercentiles: [], blockTag: 'latest', }); + console.log(feeHistory); const baseFeePerBlobGas = (feeHistory.baseFeePerBlobGas ?? []).at(-1) ?? 1n; const maxFeePerBlobGas = baseFeePerBlobGas * 3n; From d670258a396cfd18f745a86b02478bda13dc2f69 Mon Sep 17 00:00:00 2001 From: StackOverflowExcept1on <109800286+StackOverflowExcept1on@users.noreply.github.com> Date: Wed, 1 Apr 2026 16:36:03 +0300 Subject: [PATCH 16/19] fix pkg and feeHistory --- apis/vara-eth/package.json | 2 +- apis/vara-eth/src/eth/router.ts | 5 ++- apis/vara-eth/test/router.test.ts | 8 ++--- idea/gear/faucet/package.json | 2 +- idea/vara-eth/frontend/package.json | 2 +- idea/vara-eth/indexer/package.json | 2 +- yarn.lock | 50 ++++++++++++++--------------- 7 files changed, 37 insertions(+), 34 deletions(-) diff --git a/apis/vara-eth/package.json b/apis/vara-eth/package.json index 6a70692574..3acbd11b91 100644 --- a/apis/vara-eth/package.json +++ b/apis/vara-eth/package.json @@ -44,7 +44,7 @@ "devDependencies": { "@types/ws": "8.18.1", "kzg-wasm": "1.0.0", - "viem": "npm:@vara-eth/viem@2.47.7", + "viem": "https://pkg.pr.new/StackOverflowExcept1on/viem/viem@a2e9357", "ws": "8.18.3" }, "files": [ diff --git a/apis/vara-eth/src/eth/router.ts b/apis/vara-eth/src/eth/router.ts index 62d30a8bfc..8233a1d067 100644 --- a/apis/vara-eth/src/eth/router.ts +++ b/apis/vara-eth/src/eth/router.ts @@ -244,7 +244,10 @@ export class RouterClient extends BaseContractClient implements IRouterContract }); console.log(feeHistory); - const baseFeePerBlobGas = (feeHistory.baseFeePerBlobGas ?? []).at(-1) ?? 1n; + const baseFeePerBlobGas = (feeHistory.baseFeePerBlobGas ?? []).at(-1); + if (!baseFeePerBlobGas) { + throw new Error('Failed to get baseFeePerBlobGas'); + } const maxFeePerBlobGas = baseFeePerBlobGas * 3n; const tx = { diff --git a/apis/vara-eth/test/router.test.ts b/apis/vara-eth/test/router.test.ts index aace973d69..15dfeec625 100644 --- a/apis/vara-eth/test/router.test.ts +++ b/apis/vara-eth/test/router.test.ts @@ -10,7 +10,7 @@ import { walletClientToSigner } from '../src/signer'; import { waitNBlocks } from './common'; const code = fs.readFileSync(path.join(config.targetDir, 'counter.opt.wasm')); -let codeId: `0x${string}`; +let codeId: Hex; let publicClient: PublicClient; let walletClient: WalletClient; let signer: ITransactionSigner; @@ -97,7 +97,7 @@ describe('router', () => { const receipt = await publicClient.waitForTransactionReceipt({ hash: deployHash }); - const contractAddr = receipt.contractAddress?.toLowerCase() as `0x${string}` | undefined; + const contractAddr = receipt.contractAddress?.toLowerCase() as Hex | undefined; if (!contractAddr) { throw new Error('Counter ABI deployment failed'); @@ -232,14 +232,14 @@ describe('router', () => { test('should check if addresses are validators', async () => { const validators = await router.validators(); - const isValid = await router.areValidators(validators as `0x${string}`[]); + const isValid = await router.areValidators(validators as Hex[]); expect(isValid).toBeDefined(); expect(typeof isValid).toBe('boolean'); }); test('should return false for non-validator addresses', async () => { const notValidator = '0x0000000000000000000000000000000000000001'; - const isValid = await router.areValidators([notValidator as `0x${string}`]); + const isValid = await router.areValidators([notValidator as Hex]); expect(isValid).toBe(false); }); diff --git a/idea/gear/faucet/package.json b/idea/gear/faucet/package.json index 45cde7059e..513d5a06de 100644 --- a/idea/gear/faucet/package.json +++ b/idea/gear/faucet/package.json @@ -27,7 +27,7 @@ "reflect-metadata": "0.2.2", "swagger-ui-express": "5.0.1", "typeorm": "0.3.28", - "viem": "npm:@vara-eth/viem@2.47.7", + "viem": "https://pkg.pr.new/StackOverflowExcept1on/viem/viem@a2e9357", "winston": "3.19.0", "xxhashjs": "0.2.2", "yamljs": "0.3.0" diff --git a/idea/vara-eth/frontend/package.json b/idea/vara-eth/frontend/package.json index fbd4314fe1..a6e8bda4da 100644 --- a/idea/vara-eth/frontend/package.json +++ b/idea/vara-eth/frontend/package.json @@ -26,7 +26,7 @@ "react-syntax-highlighter": "15.6.6", "sails-js": "0.5.1", "sails-js-parser": "0.5.1", - "viem": "npm:@vara-eth/viem@2.47.7", + "viem": "https://pkg.pr.new/StackOverflowExcept1on/viem/viem@a2e9357", "wagmi": "2.19.4", "zod": "4.3.6" }, diff --git a/idea/vara-eth/indexer/package.json b/idea/vara-eth/indexer/package.json index 8845179921..1b0905a642 100644 --- a/idea/vara-eth/indexer/package.json +++ b/idea/vara-eth/indexer/package.json @@ -36,7 +36,7 @@ "reflect-metadata": "^0.2.2", "rxjs": "^7.8.2", "typeorm": "0.3.28", - "viem": "npm:@vara-eth/viem@2.47.7", + "viem": "https://pkg.pr.new/StackOverflowExcept1on/viem/viem@a2e9357", "xxhash-addon": "^2.0.3" }, "devDependencies": { diff --git a/yarn.lock b/yarn.lock index eee26afdc5..4c2e2cd81c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -10429,7 +10429,7 @@ __metadata: "@noble/hashes": "npm:1.8.0" "@types/ws": "npm:8.18.1" kzg-wasm: "npm:1.0.0" - viem: "npm:@vara-eth/viem@2.47.7" + viem: "https://pkg.pr.new/StackOverflowExcept1on/viem/viem@a2e9357" ws: "npm:8.18.3" peerDependencies: kzg-wasm: 1.0.0 @@ -16271,7 +16271,7 @@ __metadata: supertest: "npm:^7.1.4" swagger-ui-express: "npm:5.0.1" typeorm: "npm:0.3.28" - viem: "npm:@vara-eth/viem@2.47.7" + viem: "https://pkg.pr.new/StackOverflowExcept1on/viem/viem@a2e9357" winston: "npm:3.19.0" xxhashjs: "npm:0.2.2" yamljs: "npm:0.3.0" @@ -25767,7 +25767,7 @@ __metadata: react-syntax-highlighter: "npm:15.6.6" sails-js: "npm:0.5.1" sails-js-parser: "npm:0.5.1" - viem: "npm:@vara-eth/viem@2.47.7" + viem: "https://pkg.pr.new/StackOverflowExcept1on/viem/viem@a2e9357" wagmi: "npm:2.19.4" zod: "npm:4.3.6" languageName: unknown @@ -25801,7 +25801,7 @@ __metadata: reflect-metadata: "npm:^0.2.2" rxjs: "npm:^7.8.2" typeorm: "npm:0.3.28" - viem: "npm:@vara-eth/viem@2.47.7" + viem: "https://pkg.pr.new/StackOverflowExcept1on/viem/viem@a2e9357" xxhash-addon: "npm:^2.0.3" languageName: unknown linkType: soft @@ -25813,6 +25813,27 @@ __metadata: languageName: node linkType: hard +"viem@https://pkg.pr.new/StackOverflowExcept1on/viem/viem@a2e9357": + version: 2.47.8-a2e9357.0 + resolution: "viem@https://pkg.pr.new/StackOverflowExcept1on/viem/viem@a2e9357" + dependencies: + "@noble/curves": "npm:1.9.1" + "@noble/hashes": "npm:1.8.0" + "@scure/bip32": "npm:1.7.0" + "@scure/bip39": "npm:1.6.0" + abitype: "npm:1.2.3" + isows: "npm:1.0.7" + ox: "npm:0.14.7" + ws: "npm:8.18.3" + peerDependencies: + typescript: ">=5.0.4" + peerDependenciesMeta: + typescript: + optional: true + checksum: 10c0/5b9bdf3fb06d9e09d28b9a7998269ef0b612fdb0c61f21daa820e2b1c02225786aa1d743112bcf62fba4e7072d8c5ea8ad3c5d131cea91cc4fb80175979d16a3 + languageName: node + linkType: hard + "viem@npm:2.23.2": version: 2.23.2 resolution: "viem@npm:2.23.2" @@ -25855,27 +25876,6 @@ __metadata: languageName: node linkType: hard -"viem@npm:@vara-eth/viem@2.47.7": - version: 2.47.7 - resolution: "@vara-eth/viem@npm:2.47.7" - dependencies: - "@noble/curves": "npm:1.9.1" - "@noble/hashes": "npm:1.8.0" - "@scure/bip32": "npm:1.7.0" - "@scure/bip39": "npm:1.6.0" - abitype: "npm:1.2.3" - isows: "npm:1.0.7" - ox: "npm:0.14.7" - ws: "npm:8.18.3" - peerDependencies: - typescript: ">=5.0.4" - peerDependenciesMeta: - typescript: - optional: true - checksum: 10c0/939955e6b6b9d078cd1c09c53b29f3093303243ccaf3dbae2f50b2fb5447e019759d30f9dff2384af93748c624b97f1833d41e6a242f4f2ab1e5a2caf5fc4732 - languageName: node - linkType: hard - "vite-plugin-checker@npm:0.12.0": version: 0.12.0 resolution: "vite-plugin-checker@npm:0.12.0" From 9476bda0288a8976f0d65d351f9f21e408f6db58 Mon Sep 17 00:00:00 2001 From: StackOverflowExcept1on <109800286+StackOverflowExcept1on@users.noreply.github.com> Date: Wed, 1 Apr 2026 16:40:07 +0300 Subject: [PATCH 17/19] revert frontend part (will be moved to another PR) --- .../src/components/navigation/navigation.tsx | 10 ++- .../frontend/src/features/codes/index.ts | 1 - .../frontend/src/features/codes/lib/index.ts | 1 - .../src/features/codes/lib/use-upload-code.ts | 37 ---------- .../frontend/src/features/codes/ui/index.ts | 1 - .../codes/ui/upload-code-button/index.ts | 1 - .../upload-code-button.module.scss | 3 - .../upload-code-button/upload-code-button.tsx | 68 ------------------- utils/frontend-configs/src/vite.ts | 33 +-------- 9 files changed, 11 insertions(+), 144 deletions(-) delete mode 100644 idea/vara-eth/frontend/src/features/codes/lib/use-upload-code.ts delete mode 100644 idea/vara-eth/frontend/src/features/codes/ui/index.ts delete mode 100644 idea/vara-eth/frontend/src/features/codes/ui/upload-code-button/index.ts delete mode 100644 idea/vara-eth/frontend/src/features/codes/ui/upload-code-button/upload-code-button.module.scss delete mode 100644 idea/vara-eth/frontend/src/features/codes/ui/upload-code-button/upload-code-button.tsx diff --git a/idea/vara-eth/frontend/src/components/navigation/navigation.tsx b/idea/vara-eth/frontend/src/components/navigation/navigation.tsx index 06d9bc2cc0..e3049b34ce 100644 --- a/idea/vara-eth/frontend/src/components/navigation/navigation.tsx +++ b/idea/vara-eth/frontend/src/components/navigation/navigation.tsx @@ -2,11 +2,12 @@ import { clsx } from 'clsx'; import { matchPath, NavLink, useLocation } from 'react-router-dom'; import { Hex } from 'viem'; -import { UploadCodeButton } from '@/features/codes'; import { CreateProgramButton } from '@/features/programs'; import { Search } from '@/features/search'; import { routes } from '@/shared/config'; +import { LinkButton } from '../ui'; + import styles from './navigation.module.scss'; const LINKS = [ @@ -31,8 +32,13 @@ const Navigation = () => {
{renderLinks()}
+ {matchPath(routes.codes, pathname) && ( + + Upload Code + + )} + {codeId && } - {matchPath(routes.codes, pathname) && }
{/* key to reset search on route change */} diff --git a/idea/vara-eth/frontend/src/features/codes/index.ts b/idea/vara-eth/frontend/src/features/codes/index.ts index 3732853821..a3b47683c4 100644 --- a/idea/vara-eth/frontend/src/features/codes/index.ts +++ b/idea/vara-eth/frontend/src/features/codes/index.ts @@ -1,2 +1 @@ -export { UploadCodeButton } from './ui'; export { useGetAllCodesQuery, CODE_STATUS } from './lib'; diff --git a/idea/vara-eth/frontend/src/features/codes/lib/index.ts b/idea/vara-eth/frontend/src/features/codes/lib/index.ts index 2247e7fc28..482a0d4073 100644 --- a/idea/vara-eth/frontend/src/features/codes/lib/index.ts +++ b/idea/vara-eth/frontend/src/features/codes/lib/index.ts @@ -1,2 +1 @@ -export { useUploadCode } from './use-upload-code'; export { useGetAllCodesQuery, CODE_STATUS } from './queries'; diff --git a/idea/vara-eth/frontend/src/features/codes/lib/use-upload-code.ts b/idea/vara-eth/frontend/src/features/codes/lib/use-upload-code.ts deleted file mode 100644 index 74b33b0857..0000000000 --- a/idea/vara-eth/frontend/src/features/codes/lib/use-upload-code.ts +++ /dev/null @@ -1,37 +0,0 @@ -import { useMutation } from '@tanstack/react-query'; -import { generatePath, useNavigate } from 'react-router-dom'; - -import { useApi } from '@/app/api'; -import { useAddMyActivity } from '@/app/store'; -import { TransactionTypes, unpackReceipt } from '@/app/store/my-activity'; -import { routes } from '@/shared/config'; - -export const useUploadCode = () => { - const { data: api } = useApi(); - const navigate = useNavigate(); - const addMyActivity = useAddMyActivity(); - - const uploadCode = async (code: Uint8Array) => { - if (!api) return; - - const tx = await api.eth.router.requestCodeValidation(code); - await tx.send(); - const isValidated = await tx.waitForCodeGotValidated(); - const codeId = tx.codeId; - const receipt = await tx.getReceipt(); - - await addMyActivity({ - type: TransactionTypes.codeValidation, - codeId, - resultStatus: isValidated ? 'success' : 'error', - error: isValidated ? undefined : 'validation error', - ...unpackReceipt(receipt), - }); - - void navigate(generatePath(routes.code, { codeId })); - }; - - const mutation = useMutation({ mutationFn: uploadCode }); - - return mutation; -}; diff --git a/idea/vara-eth/frontend/src/features/codes/ui/index.ts b/idea/vara-eth/frontend/src/features/codes/ui/index.ts deleted file mode 100644 index 1c161e333e..0000000000 --- a/idea/vara-eth/frontend/src/features/codes/ui/index.ts +++ /dev/null @@ -1 +0,0 @@ -export { UploadCodeButton } from './upload-code-button'; diff --git a/idea/vara-eth/frontend/src/features/codes/ui/upload-code-button/index.ts b/idea/vara-eth/frontend/src/features/codes/ui/upload-code-button/index.ts deleted file mode 100644 index 1c161e333e..0000000000 --- a/idea/vara-eth/frontend/src/features/codes/ui/upload-code-button/index.ts +++ /dev/null @@ -1 +0,0 @@ -export { UploadCodeButton } from './upload-code-button'; diff --git a/idea/vara-eth/frontend/src/features/codes/ui/upload-code-button/upload-code-button.module.scss b/idea/vara-eth/frontend/src/features/codes/ui/upload-code-button/upload-code-button.module.scss deleted file mode 100644 index a48ce97be9..0000000000 --- a/idea/vara-eth/frontend/src/features/codes/ui/upload-code-button/upload-code-button.module.scss +++ /dev/null @@ -1,3 +0,0 @@ -.input { - display: none; -} diff --git a/idea/vara-eth/frontend/src/features/codes/ui/upload-code-button/upload-code-button.tsx b/idea/vara-eth/frontend/src/features/codes/ui/upload-code-button/upload-code-button.tsx deleted file mode 100644 index 760a8fa620..0000000000 --- a/idea/vara-eth/frontend/src/features/codes/ui/upload-code-button/upload-code-button.tsx +++ /dev/null @@ -1,68 +0,0 @@ -import { useRef, useState } from 'react'; -import { useAccount } from 'wagmi'; - -import { Button, Modal } from '@/components'; -import { useUploadCode } from '@/features/codes/lib'; - -import styles from './upload-code-button.module.scss'; - -export const UploadCodeButton = () => { - const uploadCode = useUploadCode(); - const inputRef = useRef(null); - const [isOpen, setIsOpen] = useState(false); - const { address } = useAccount(); - - if (!address) return null; - - const onSelectFile = () => { - inputRef.current?.click(); - }; - - const handleFileUpload: React.ChangeEventHandler = (event) => { - const file = event.target.files?.[0]; - if (!file) return; - - const reader = new FileReader(); - reader.onload = function () { - const arrayBuffer = reader.result; - if (!arrayBuffer || typeof arrayBuffer === 'string') return; - const uint8Array = new Uint8Array(arrayBuffer); - - uploadCode.mutate(uint8Array, { - onError: () => { - setIsOpen(false); - }, - }); - }; - reader.readAsArrayBuffer(file); - }; - - return ( - <> - - - {isOpen && ( - setIsOpen(false)} - action={ - - }> - {/* TODO: add drop area */} - - - )} - - ); -}; diff --git a/utils/frontend-configs/src/vite.ts b/utils/frontend-configs/src/vite.ts index df77c8c945..47e508b14a 100644 --- a/utils/frontend-configs/src/vite.ts +++ b/utils/frontend-configs/src/vite.ts @@ -1,39 +1,13 @@ -import { readFileSync } from 'fs'; -import { createRequire } from 'module'; -import { dirname, resolve } from 'path'; -import { fileURLToPath } from 'url'; +import { resolve } from 'path'; import react from '@vitejs/plugin-react-swc'; -import { defineConfig, type PluginOption } from 'vite'; +import { defineConfig } from 'vite'; import { checker } from 'vite-plugin-checker'; import { nodePolyfills } from 'vite-plugin-node-polyfills'; import svgr from 'vite-plugin-svgr'; import dts from 'vite-plugin-dts'; import { externalizeDeps } from 'vite-plugin-externalize-deps'; -const require = createRequire(import.meta.url); -const __dirname = dirname(fileURLToPath(import.meta.url)); - -const serveKzgWasmFromViteCachePath = (): PluginOption => { - const kzgEntry = require.resolve('kzg-wasm', { paths: [process.cwd()] }); - const wasmPath = resolve(dirname(kzgEntry), '..', 'wasm', 'kzg.wasm'); - - return { - name: 'serve-kzg-wasm-vite-cache-path', - apply: 'serve', - configureServer(server) { - server.middlewares.use('/node_modules/.vite/wasm/kzg.wasm', (_req, res) => { - const wasm = readFileSync(wasmPath); - - res.statusCode = 200; - res.setHeader('Content-Type', 'application/wasm'); - res.setHeader('Cache-Control', 'no-store'); - res.end(wasm); - }); - }, - }; -}; - const options = { server: { port: 3000, open: true }, preview: { port: 3001, open: true }, @@ -43,8 +17,7 @@ const options = { const plugins = [ react(), svgr(), - serveKzgWasmFromViteCachePath(), - nodePolyfills({ globals: { process: false } }), + nodePolyfills(), checker({ typescript: { buildMode: true }, eslint: { lintCommand: 'eslint .', useFlatConfig: true } }), ]; From 813d827a1e7b7cd31c62f2c75cf9487e145c96e2 Mon Sep 17 00:00:00 2001 From: StackOverflowExcept1on <109800286+StackOverflowExcept1on@users.noreply.github.com> Date: Wed, 1 Apr 2026 19:18:23 +0300 Subject: [PATCH 18/19] remove console log --- apis/vara-eth/src/eth/router.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/apis/vara-eth/src/eth/router.ts b/apis/vara-eth/src/eth/router.ts index 8233a1d067..7e5e39914a 100644 --- a/apis/vara-eth/src/eth/router.ts +++ b/apis/vara-eth/src/eth/router.ts @@ -242,7 +242,6 @@ export class RouterClient extends BaseContractClient implements IRouterContract rewardPercentiles: [], blockTag: 'latest', }); - console.log(feeHistory); const baseFeePerBlobGas = (feeHistory.baseFeePerBlobGas ?? []).at(-1); if (!baseFeePerBlobGas) { From 53ae489e0e6a6ab2959ef45e4219d46fa60704e1 Mon Sep 17 00:00:00 2001 From: Dmitri Osipov Date: Thu, 2 Apr 2026 12:06:03 +0200 Subject: [PATCH 19/19] bump version, update readme, changelog --- apis/vara-eth/CHANGELOG.md | 15 +++++++++ apis/vara-eth/README.md | 4 ++- apis/vara-eth/package.json | 4 +-- idea/gear/faucet/package.json | 2 +- idea/vara-eth/frontend/package.json | 2 +- idea/vara-eth/indexer/package.json | 2 +- yarn.lock | 50 ++++++++++++++--------------- 7 files changed, 48 insertions(+), 31 deletions(-) diff --git a/apis/vara-eth/CHANGELOG.md b/apis/vara-eth/CHANGELOG.md index 07e9d4b61f..b6a5fa7613 100644 --- a/apis/vara-eth/CHANGELOG.md +++ b/apis/vara-eth/CHANGELOG.md @@ -4,6 +4,21 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/). +## [0.3.1] + +### Added + +- `RouterClient.requestCodeValidation()` method (previously private and unimplemented) for uploading Wasm program code as an EIP-7594 blob transaction (https://github.com/gear-tech/gear-js/pull/2405) +- EIP-7594 multi-blob encoding via `simpleSidecarEncode()` — replaces the old single-blob `prepareBlob()` and correctly encodes arbitrary-length data across multiple blobs following the Simple Sidecar Encoding format (https://github.com/gear-tech/gear-js/pull/2405) +- `computeCellsAndKzgProofs` KZG hook required by EIP-7594 (https://github.com/gear-tech/gear-js/pull/2405) + +### Changed + +- Peer dependency `viem` switched from `^2.39.0` to `@vara-eth/viem@2.47.7-1` — a temporary fork at https://github.com/StackOverflowExcept1on/viem/tree/feat/eip-7594-support-for-blob-txs that adds EIP-7594 blob transaction support not yet available upstream; will revert to the official package once merged (https://github.com/gear-tech/gear-js/pull/2405) +- `requestCodeValidation` blob transactions now use `blobVersion: '7594'` (EIP-7594) instead of the standard EIP-4844 format (https://github.com/gear-tech/gear-js/pull/2405) +- `maxFeePerBlobGas` is now derived dynamically from `getFeeHistory` (3× the latest base fee) instead of the previous hardcoded value (https://github.com/gear-tech/gear-js/pull/2405) +- Gas limit for code validation transactions is now estimated via `estimateGas` instead of a hardcoded value (https://github.com/gear-tech/gear-js/pull/2405) + ## [0.3.0] ### Added diff --git a/apis/vara-eth/README.md b/apis/vara-eth/README.md index 063c26e774..ca824d67c3 100644 --- a/apis/vara-eth/README.md +++ b/apis/vara-eth/README.md @@ -46,9 +46,11 @@ npm install @vara-eth/api Install required peer dependencies: ```bash -npm install viem@npm:@vara-eth/viem@2.47.7 kzg-wasm@1.0.0 +npm install viem@npm:@vara-eth/viem@2.47.7-1 kzg-wasm@1.0.0 ``` +> **Note:** `@vara-eth/viem` is a temporary fork of [viem](https://viem.sh) that adds support for [EIP-7594](https://eips.ethereum.org/EIPS/eip-7594), which is not yet available in the upstream package. Once EIP-7594 support lands in the official viem release, this library will switch back to the original package. + ## Quick Start ```typescript diff --git a/apis/vara-eth/package.json b/apis/vara-eth/package.json index 3acbd11b91..fd3fee5a79 100644 --- a/apis/vara-eth/package.json +++ b/apis/vara-eth/package.json @@ -1,6 +1,6 @@ { "name": "@vara-eth/api", - "version": "0.3.0", + "version": "0.3.1", "description": "Typescript library for interacting with Vara.Eth network", "repository": { "type": "git", @@ -44,7 +44,7 @@ "devDependencies": { "@types/ws": "8.18.1", "kzg-wasm": "1.0.0", - "viem": "https://pkg.pr.new/StackOverflowExcept1on/viem/viem@a2e9357", + "viem": "npm:@vara-eth/viem@2.47.7-1", "ws": "8.18.3" }, "files": [ diff --git a/idea/gear/faucet/package.json b/idea/gear/faucet/package.json index 513d5a06de..a23239bd7f 100644 --- a/idea/gear/faucet/package.json +++ b/idea/gear/faucet/package.json @@ -27,7 +27,7 @@ "reflect-metadata": "0.2.2", "swagger-ui-express": "5.0.1", "typeorm": "0.3.28", - "viem": "https://pkg.pr.new/StackOverflowExcept1on/viem/viem@a2e9357", + "viem": "npm:@vara-eth/viem@2.47.7-1", "winston": "3.19.0", "xxhashjs": "0.2.2", "yamljs": "0.3.0" diff --git a/idea/vara-eth/frontend/package.json b/idea/vara-eth/frontend/package.json index a6e8bda4da..cc502b973c 100644 --- a/idea/vara-eth/frontend/package.json +++ b/idea/vara-eth/frontend/package.json @@ -26,7 +26,7 @@ "react-syntax-highlighter": "15.6.6", "sails-js": "0.5.1", "sails-js-parser": "0.5.1", - "viem": "https://pkg.pr.new/StackOverflowExcept1on/viem/viem@a2e9357", + "viem": "npm:@vara-eth/viem@2.47.7-1", "wagmi": "2.19.4", "zod": "4.3.6" }, diff --git a/idea/vara-eth/indexer/package.json b/idea/vara-eth/indexer/package.json index 1b0905a642..50bd586d6c 100644 --- a/idea/vara-eth/indexer/package.json +++ b/idea/vara-eth/indexer/package.json @@ -36,7 +36,7 @@ "reflect-metadata": "^0.2.2", "rxjs": "^7.8.2", "typeorm": "0.3.28", - "viem": "https://pkg.pr.new/StackOverflowExcept1on/viem/viem@a2e9357", + "viem": "npm:@vara-eth/viem@2.47.7-1", "xxhash-addon": "^2.0.3" }, "devDependencies": { diff --git a/yarn.lock b/yarn.lock index 4c2e2cd81c..5922e3bfb3 100644 --- a/yarn.lock +++ b/yarn.lock @@ -10429,7 +10429,7 @@ __metadata: "@noble/hashes": "npm:1.8.0" "@types/ws": "npm:8.18.1" kzg-wasm: "npm:1.0.0" - viem: "https://pkg.pr.new/StackOverflowExcept1on/viem/viem@a2e9357" + viem: "npm:@vara-eth/viem@2.47.7-1" ws: "npm:8.18.3" peerDependencies: kzg-wasm: 1.0.0 @@ -16271,7 +16271,7 @@ __metadata: supertest: "npm:^7.1.4" swagger-ui-express: "npm:5.0.1" typeorm: "npm:0.3.28" - viem: "https://pkg.pr.new/StackOverflowExcept1on/viem/viem@a2e9357" + viem: "npm:@vara-eth/viem@2.47.7-1" winston: "npm:3.19.0" xxhashjs: "npm:0.2.2" yamljs: "npm:0.3.0" @@ -25767,7 +25767,7 @@ __metadata: react-syntax-highlighter: "npm:15.6.6" sails-js: "npm:0.5.1" sails-js-parser: "npm:0.5.1" - viem: "https://pkg.pr.new/StackOverflowExcept1on/viem/viem@a2e9357" + viem: "npm:@vara-eth/viem@2.47.7-1" wagmi: "npm:2.19.4" zod: "npm:4.3.6" languageName: unknown @@ -25801,7 +25801,7 @@ __metadata: reflect-metadata: "npm:^0.2.2" rxjs: "npm:^7.8.2" typeorm: "npm:0.3.28" - viem: "https://pkg.pr.new/StackOverflowExcept1on/viem/viem@a2e9357" + viem: "npm:@vara-eth/viem@2.47.7-1" xxhash-addon: "npm:^2.0.3" languageName: unknown linkType: soft @@ -25813,27 +25813,6 @@ __metadata: languageName: node linkType: hard -"viem@https://pkg.pr.new/StackOverflowExcept1on/viem/viem@a2e9357": - version: 2.47.8-a2e9357.0 - resolution: "viem@https://pkg.pr.new/StackOverflowExcept1on/viem/viem@a2e9357" - dependencies: - "@noble/curves": "npm:1.9.1" - "@noble/hashes": "npm:1.8.0" - "@scure/bip32": "npm:1.7.0" - "@scure/bip39": "npm:1.6.0" - abitype: "npm:1.2.3" - isows: "npm:1.0.7" - ox: "npm:0.14.7" - ws: "npm:8.18.3" - peerDependencies: - typescript: ">=5.0.4" - peerDependenciesMeta: - typescript: - optional: true - checksum: 10c0/5b9bdf3fb06d9e09d28b9a7998269ef0b612fdb0c61f21daa820e2b1c02225786aa1d743112bcf62fba4e7072d8c5ea8ad3c5d131cea91cc4fb80175979d16a3 - languageName: node - linkType: hard - "viem@npm:2.23.2": version: 2.23.2 resolution: "viem@npm:2.23.2" @@ -25876,6 +25855,27 @@ __metadata: languageName: node linkType: hard +"viem@npm:@vara-eth/viem@2.47.7-1": + version: 2.47.7-1 + resolution: "@vara-eth/viem@npm:2.47.7-1" + dependencies: + "@noble/curves": "npm:1.9.1" + "@noble/hashes": "npm:1.8.0" + "@scure/bip32": "npm:1.7.0" + "@scure/bip39": "npm:1.6.0" + abitype: "npm:1.2.3" + isows: "npm:1.0.7" + ox: "npm:0.14.7" + ws: "npm:8.18.3" + peerDependencies: + typescript: ">=5.0.4" + peerDependenciesMeta: + typescript: + optional: true + checksum: 10c0/52ee49f8aaebcf80d38384ba887f820f589f7e210eae24438ba4d89fdd50049659eaa6c3be025ab53a94ff9cdedf9abbaec41ed5f23f5e9497df5626b3b0b4d2 + languageName: node + linkType: hard + "vite-plugin-checker@npm:0.12.0": version: 0.12.0 resolution: "vite-plugin-checker@npm:0.12.0"