Summary
A Hardhat + Foundry add-on that measures execution gas and pubdata bytes on zkSync Era (including bootloader overhead) and outputs a conservative gas_per_pubdata_limit recommendation per call. Built to integrate with existing zkSync developer workflows, shipped as standalone plugins and upstream PRs (best-effort).
Problem
On zkSync Era, user fees depend on L2 execution gas + pubdata (bytes posted for state diffs, logs/messages, bytecode). Pubdata volume is only known post-execution, and common gas reporters don’t provide a zkSync-accurate breakdown or make bootloader overhead visible.
Consequences:
- Mis-sized
gas_per_pubdata_limitcan cause reverts or unnecessarily high fees. - Teams lack a clear, per-function view of where costs originate (storage vs. logs/messages vs. bytecode).
- CI lacks a simple guardrail to catch pubdata-heavy changes before merge.
Solution
A profiling layer that runs in tests/scripts (and ad-hoc) to:
- Measure: execution gas and pubdata bytes by category (storage writes, L2→L1 logs, L2→L1 messages, bytecode publish), with bootloader overhead shown explicitly.
- Price: the footprint using current batch parameters from zkSync JSON-RPC.
- Recommend: a conservative
gas_per_pubdata_limitand warn/fail when a call likely exceeds safe bounds. - Output: a developer-friendly table and machine-readable JSON suitable for CI.
Non-Overlap & Stack Fit
- No devnet/orchestrator duplication. We reuse anvil-zksync and official Hardhat/Foundry zkSync integrations for execution and traces.
- To our knowledge, there is no publicly documented pubdata-aware profiler in the official plugin sets; our scope is limited to fee visibility and recommendations.
- Upstream PRs will be opened, but the standalone plugins deliver value independently of merge timing.
Technical Implementation Plan
Architecture
- Core library (TypeScript; thin bindings if needed):
- Trace ingestion (debug RPC where available; otherwise anvil-zksync verbose tracing).
- Pubdata classification & byte counters aligned to protocol categories.
- Fee calculator reading current batch parameters via documented zkSync JSON-RPC.
gas_per_pubdata_limitadvisor (conservative by default; never auto-injects without an explicit flag).
Integrations
- Foundry reporter:
forge test --zks-fee-profiler→ table + JSON (exec gas, pubdata by category, bootloader overhead, recommendedgas_per_pubdata_limit, estimated fee). - Hardhat task/reporter:
npx hardhat analyze:feeswith Mocha annotations. - Thin CLI:
zks-fee analyze <tx|script>against anvil or a forked Era RPC.
**Method **
- Execute/trace locally, derive state-diff signals, and attribute pubdata bytes to categories.
- Read current batch inputs via JSON-RPC and compute an estimated fee; show bootloader overhead as a distinct line item.
- Recommend a conservative
gas_per_pubdata_limit(SDKs may expose this asgasPerPubdata/gasPerPubdataLimit).
Deliverables
- Core OSS library: pubdata classification, fee calculator, conservative limit advisor.
- Foundry integration: reporter flag + JSON output; tests and examples.
- Hardhat integration: task/reporter package; examples.
- Standalone CLI for ad-hoc analysis.
- Three example repos demonstrating storage-heavy patterns; L2→L1 logs/messages; bytecode size/factoryDeps trade-offs.
- Docs: “Fees on zkSync for engineers”—how to read reports, set limits, wire CI.
Milestones
Milestone 1: Profiling Kernel (Weeks 1–2) — $15,000
- Byte counters by category; bootloader line item; pricing from JSON-RPC; CLI PoC.
- Acceptance: On 10 canonical calls, stable category counts; table + JSON emitted.
Milestone 2: Foundry Reporter (Weeks 3–4) — $12,000
- Reporter flag + JSON; docs; 10-case test set.
- Acceptance: For the set, median fee delta ≤5%, p95 ≤10% versus fees computed from current batch parameters.
Milestone 3: Hardhat Task/Reporter (Week 5) — $7,000
- Task + annotations; examples.
- Acceptance: Same deltas achieved on anvil and a forked provider.
Milestone 4: Advisor & CI Guardrails (Weeks 6–7) — $8,000
- Conservative
gas_per_pubdata_limitadvisor; CI sample that flags unsafe diffs. - Acceptance: On a 20-case suite, recommendations prevent pubdata-limit reverts; CI passes with reproducible outputs.
Milestone 5: Conformance & Docs (Weeks 8–9) — $8,000
- 20+ case suite; delta dashboard script; developer guide.
- Acceptance: Suite meets median/p95 targets; docs published.
Budget (Total $50,000)
- Core engineering (kernel + pricing + advisor): $30,000
- Integrations & tests (Foundry/Hardhat, CI, 20+ vectors): $7,000
- Docs & examples (3 repos + guide): $6,000
- Maintenance buffer (6 months for RPC/fee-model updates): $7,000
Acceptance Criteria (objective)
- Accuracy: On ≥20 canonical interactions, median fee delta ≤5%, p95 ≤10% vs. fees derived from current batch parameters; category bytes consistent with traces.
- Safety: Default (conservative)
gas_per_pubdata_limitrecommendations avoid pubdata-limit reverts in the suite; warnings surface likely over-cap calls. - DX: One-command setup; works with current Era testnet/mainnet and anvil-zksync; JSON artifacts are CI-ready.
- Upstreamability: PRs opened; plugins usable independently of merges.
Risks & Mitigations
- RPC/spec churn → Adapter layer; version-pinned CI; funded maintenance buffer.
- Trace opacity → Dual backends (debug RPC where available; anvil verbose locally) + explicit bootloader line item with reconciliation notes.
- Overlap optics → Strictly fee-profiling scope; no devnet/orchestrator; integrates into existing Foundry/Hardhat flows.
Maintenance & Sustainability
- 3-month upkeep to track RPC/fee changes and keep CI green.
- Compact codebase, contributor guide, and conformance tests to ease long-term maintenance.
- License: MIT. Packages published to NPM; examples in public repos.
Impact & Targets
- Accuracy target: median fee delta ≤5%, p95 ≤10% on the suite.
- DX target: single-call local report ≤2s on typical dev machines.
- Adoption target: early downloads across plugin packages in the first 60 days (tracked via NPM stats).
Team & Past Work
About us
Dapps over Apps is a collective advancing Web3 through developer tooling and education. We build practical, open-source tools that improve developer experience (DX) and onboard new builders.
Selected Past Work
-
VoxBridge – VoxEdit → Unity/Roblox Converter — a professional asset converter for Sandbox creators and game pipelines.
Repo: GitHub - Supercoolkayy/voxbridge: VoxBridge: convert VoxEdit glTF/GLB assets to engine-ready files for Unity and Roblox -
Arbitrum precompiles (local testing patch) — adds native support for ArbSys (0x64), ArbGasInfo (0x6c) and tx type 0x7e (deposits) to Hardhat and Foundry (Anvil) for realistic local dev.
-
Ox-rollup — research/verification repo and docs.
Site: www.ox-rollup.com • Repo: Supercoolkayy/Ox-rollup (verify/m2-step1) -
RetrievalTester (Filecoin) — utility that tests CID retrieval performance across multiple public gateways.
App: https://www.retrievaltester.com/ -
Arbitrum Stylus VS Code extension — improves DX for Stylus smart-contract development.
Repo: https://github.com/Supercoolkayy/Abitrum-stylus-extension/tree/
- Avatar-Everywhere CLI (Portable Sandbox Identity Toolkit) — converts Sandbox avatars → VRM for Unity/VRChat and more, with on-chain ownership verification before conversion.
Package: avatar-everywhere-cli · PyPI
Team
Abdulkareem Oyeneye — Project Lead / Developer Tooling Engineer
Leads planning and delivery for developer-tooling projects with a focus on DX and roadmap execution. For this proposal: overall architecture, stakeholder comms, and release management.
Links: LinkedIn
Gospel Ifeadi — Smart Contract Engineer
Works across Rust, C++, JavaScript, and Python; experience with contract development, automation, and tooling integrations. For this proposal: Solidity/contracts integration, test harnesses, and Hardhat/Foundry adapters.
Links: X (Twitter)
Emmanuel Charles — Blockchain Developer & QA Engineer
Background in Rust, TypeScript, and C++; blends contract engineering with rigorous QA. For this proposal: conformance test suite, CI pipelines, and artifact validation.
Links: LinkedIn
Musa Abdulkareem — ZK Engineer
Focus on protocol-level integrations and performance-minded engineering. For this proposal: bootloader/fee-model reconciliation, JSON-RPC adapters, and performance profiling.
Links: LinkedIn
Contact:
Team@dappsovers.com
X/Twitter