Skip to content

feat(wasm-analysis): implement WASM section analysis and visualizer#487

Open
HushLuxe wants to merge 2 commits intodotandev:mainfrom
MyOrgEnv:feat/source-map-issue-58
Open

feat(wasm-analysis): implement WASM section analysis and visualizer#487
HushLuxe wants to merge 2 commits intodotandev:mainfrom
MyOrgEnv:feat/source-map-issue-58

Conversation

@HushLuxe
Copy link

Closes #374

Description

This PR implements a WASM binary analysis feature for the erst CLI. It enables developers to audit contract sizes by categorizing WASM sections into Logic, Debug Info, and Data. It also includes a standalone HTML visualizer for a premium reporting experience.

Changes Made

  • Rust Simulator:
    • Integrated object crate for WASM parsing and section categorization.
    • Implemented analyze_only mode for high-performance metadata extraction.
    • Updated schemas to handle optional simulation fields.
    • Renamed binary to erst-sim for seamless Go integration.
  • Go CLI:
    • Added analyze-wasm command for standalone binary analysis.
    • Developed a self-contained HTML visualizer with charts and section tables.
    • Added source file mapping visualization.

Testing

  • Ran 8 Rust unit tests in simulator/src/source_mapper.rs and main.rs (all passed).
  • Manually verified the simulator with minimal JSON payloads for standalone analysis.
  • Verified schema synchronization between Go and Rust.

Checklist

  • Documentation updated
  • Tests passing
  • Code follows project style guidelines

@dotandev
Copy link
Owner

fix conflicts, please

@HushLuxe
Copy link
Author

Resolved

@dotandev
Copy link
Owner

fix ci and conflicts, please.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[SOURCE-MAP] Generate a HTML visualizer for WASM file sizes & mappings #158

2 participants