Skip to content

Challenges

justSid26 edited this page Apr 21, 2026 · 6 revisions

Challenges & Limitations

Challenges Faced During Development

1. Rust Learning Curve for Web Server Development

Setting up an async HTTP server in Rust with multipart file upload support required understanding several Rust-specific concepts simultaneously: the ownership model, async/await with tokio, and the axum middleware chain. Debugging borrow checker errors in async contexts was particularly time-consuming for a developer more familiar with garbage-collected languages.


2. CORS Configuration Between Frontend and Backend

The frontend (port 3001) and backend (port 3000) run on different ports, triggering browser CORS restrictions. Configuring the Rust server to respond with appropriate Access-Control-Allow-Origin headers — and handling the preflight OPTIONS request — required careful middleware setup that is not immediately obvious from basic axum examples.


3. Multipart File Streaming in Rust

Handling multipart/form-data in Rust is more verbose than in Node.js or Python. The async streaming API requires manually collecting byte chunks from the stream, which is error-prone if chunk boundaries are mishandled. Ensuring the full file is collected before passing to the validator was a non-trivial implementation detail.


4. Next.js Port Conflict & Workspace Root Warning

Running both the frontend and backend locally on separate ports led to occasional port conflicts. Additionally, Next.js 16 with Turbopack generated workspace root warnings due to multiple package-lock.json files being detected across the project directory, requiring documentation of the correct startup commands.


5. Identifying CosmWasm Compliance Rules

The exact set of checks that define a "valid" CosmWasm contract (required exports, memory limits, disallowed imports) is spread across CosmWasm documentation and source code rather than a single specification document. Consolidating these rules into a working validator required reading CosmWasm source code and cross-referencing documentation.


6. Testing with Intentionally Invalid Contracts

Generating a .wasm file that is structurally invalid (not just logically wrong) required understanding the WASM binary format at the byte level. Creating invalid.wasm as a useful test fixture — one that triggers a clear, meaningful error rather than a generic parser crash — required careful crafting.


Limitations of the System

Limitation Description
Current focus The deepest low-level binary checks are currently implemented for CosmWasm WASM. Solidity support is available in the frontend/backend flow and deployment pipeline.
Static analysis only The system checks binary structure and interface compliance. It does not simulate execution, detect logical vulnerabilities (re-entrancy, overflow), or perform gas estimation.
No deployment SmartContract validates contracts but does not deploy them to any network (testnet or mainnet).
Single file at a time The current API accepts one contract artifact (.sol or .wasm) per request. Batch validation is not supported.
No authentication The REST API has no authentication or rate limiting. Running it in a public network without a reverse proxy is insecure.
No persistent history Validation results are not stored. There is no history, dashboard, or logging of past validations.
Hardcoded ports The backend defaults to port 3000 and the frontend to port 3001 with no environment variable configuration in the current implementation.

Solidity Support, Wallet Connection, and Deployment

Solidity Contract Support

The platform also supports Solidity contract workflows in addition to CosmWasm validation. Users can select the Solidity mode from the frontend validator interface and upload .sol files. The frontend sends the selected file to the backend validation API through the same user flow. For Solidity responses, the backend can return compiled artifacts such as ABI and bytecode. This enables a continuous path from validation to deployment readiness inside one interface.

Wallet Connection Workflow

For Solidity and EVM-compatible deployment, wallet integration is handled through MetaMask. The UI provides a wallet connect button that requests account access from the browser wallet provider. Connected account state is retained in frontend context so deploy actions can use the active address. If no wallet is detected, the UI prevents deployment and prompts the user with a clear error. For CosmWasm workflows, Keplr wallet integration is used with explicit testnet chain configuration.

Contract Deployment Flow

After successful validation, users can trigger deployment from the file result row in the UI. For Solidity, deployment uses the returned bytecode and sends a transaction via eth_sendTransaction. The app then polls transaction receipt status until a contract address is available. When deployment succeeds, the deployed contract address is displayed in the interface. For CosmWasm, deployment follows upload and instantiate steps through SigningCosmWasmClient. This design keeps validation, wallet authorization, and deployment in one cohesive experience.

Operational Notes

Deployment actions are intentionally available only for contracts that pass validation first. This gating reduces accidental deployment of malformed or unverified contract artifacts. Wallet-related failures are reported to the user to support quick recovery and retries. Using this combined flow improves developer productivity during local testing and demos.

Clone this wiki locally