Stylus Toolkit — Final Milestone Report

# Stylus Toolkit — Final Milestone Report

Grant Recipient: Maheswaran Velmurugan

Project: Stylus Toolkit

This report summarizes the completion of all milestones and deliverables for the Stylus Toolkit grant.

Overview

The Stylus Toolkit is now fully complete across both milestones. What started as a CLI scaffold has grown into a full local development environment with gas analytics, historical tracking, and community infrastructure — all installable in a single npm command.


What Was Delivered

Milestone 1 laid the core foundation: a production-ready CLI with four contract templates (Basic, ERC-20, ERC-721, DeFi), a gas profiling system that deploys both Rust and Solidity contracts side-by-side, multi-network support (local, Sepolia, mainnet), and export in JSON, CSV, and HTML formats. The package was published to NPM at v0.1.0 under MIT license.

Milestone 2 extended this into a complete dev environment. A single command (stylus-toolkit dev) now spins up a local Arbitrum Stylus node via Docker with two pre-funded accounts — no manual setup. The deploy command handles gas estimation and private key management. A local analytics dashboard aggregates all profile runs with TCO trend charts and savings breakdowns. No cloud account or telemetry involved.


Verified Gas Savings

Across tested operations, Rust (Stylus) consistently outperformed Solidity — 16.7% savings on reads, 40% on writes, 46.7% on compute-heavy operations, and 27.2% on oracle calls. Average execution savings came in at 32.6%, with full TCO savings at 26.7% after 100 calls per function — well above the 25% target.


KPI Results

All primary targets were hit. NPM downloads reached 224 against a 100 target. Gas savings exceeded the 25% threshold. Local testnet runs reliably under Docker with health checks. The Discord server and YouTube channel are both live with tutorial content covering the full workflow.


Links

1 Like

@soloking Thank you for the final milestone report.

This is a solid, well-structured final milestone report. From a governance standpoint (grant accountability, transparency, verifiable delivery, and community benefit), it demonstrates strong execution and clear reporting. It effectively closes the loop on the grant by summarizing completion of both milestones, quantifying results against targets, and providing public links for independent verification. The report prioritizes outcomes over process detail, which is appropriate for a final summary, though it leaves some room for deeper scrutiny on methodology and sustainability.

Strengths:

• Clear structure and accountability: Sections (Overview, What Was Delivered, Verified Gas Savings, KPI Results, Links) make it easy for reviewers, delegates, or the community to assess delivery. Grant recipient and project are clearly identified.

• Concrete deliverables mapped to milestones: Milestone 1 (CLI foundation, templates, multi-network support, NPM publication under MIT) and Milestone 2 (one-command local Stylus node via Docker, analytics dashboard, gas estimation, private key handling) are described specifically. The “single npm command” installability and zero-manual-setup claim are particularly strong for developer experience and adoption.

• Quantified, outcome-oriented results: Gas savings are broken down by operation type (reads 16.7%, writes 40%, compute-heavy 46.7%, oracle 27.2%; average execution 32.6%, full TCO 26.7% after 100 calls) and explicitly compared to the 25% target. KPIs show over-delivery on NPM downloads (224 vs 100 target) plus live Discord and YouTube infrastructure. This is excellent evidence-based reporting.

• Transparency and openness: MIT license, public NPM package, GitHub repo, Discord, and YouTube links enable independent verification and community use. Emphasis on fully local operation (no cloud/telemetry) aligns with developer sovereignty and reduces ongoing costs/risks.

• Focus on real utility: Production-ready templates (Basic, ERC-20, ERC-721, DeFi), side-by-side Rust/Solidity profiling, multi-format export, and local analytics with TCO charts show practical value for the Arbitrum Stylus ecosystem rather than pure research.

This report reflects responsible grant stewardship: targets met or exceeded, artifacts publicly available, and a usable tool shipped.

Opinion:

The project appears to have successfully delivered a complete local development environment that lowers the barrier to Stylus adoption. Exceeding the gas-savings and download targets, combined with live community channels and tutorial content, suggests good product-market fit for developers. The local-first design is a governance positive (minimizes vendor lock-in and ongoing grant dependency).

Minor caveats from a pure governance lens: the report is high-level on how the gas numbers were generated (test suite, contract complexity, number of runs, statistical significance) and on longer-term maintenance plans. Without those details, independent reproducibility of the 26.7–32.6% savings claims requires reviewers to dig into the GitHub repo themselves. Overall, however, this is above-average final reporting quality for a toolkit grant—focused, measurable, and community-oriented.

Questions:

1. Methodology & Reproducibility
Can you share (or point to in the repo) the exact test contracts, number of runs, gas measurement methodology, and any statistical details behind the reported savings percentages? How consistent were results across different Stylus node versions or network conditions?

2. Verification of KPIs
Are the 224 NPM downloads current as of the report date, and is there a public dashboard or badge that can be monitored going forward? Any organic vs. campaign-driven breakdown?

3. Sustainability & Maintenance
What is the plan for ongoing maintenance, updates for future Stylus/Arbitrum upgrades, bug fixes, and community contributions after the grant ends? Is there a governance or funding model envisioned for the Discord/YouTube channels?

4. Security & Edge Cases
How was private-key management handled in the local environment (security model, best practices documented)? Were any security reviews or audits performed on the CLI, Docker setup, or templates?

5. Adoption & Impact Metrics
Beyond downloads, are there early usage signals (GitHub stars/forks, Discord activity, YouTube views, or known projects using the toolkit)? Any feedback from early users that informed the final version?

6. Scope Completeness
Were all original grant milestones and success criteria fully met as defined in the proposal? Are there any deferred items or known limitations that the community should be aware of?

7. Open Source Health
Is the GitHub repository fully documented (README, contribution guidelines, examples)? Are there open issues or a roadmap for post-grant development?

1 Like

The report claims 26.7% full TCO savings after 100 calls, but can you provide a fully reproducible benchmark package with the exact contracts, transaction counts, node versions, configuration, and raw gas data, so the DAO can independently verify whether the central performance claim holds in a realistic production environment? @soloking @Arb_Junior

The central issue is not missing methodology — the current profiler does not measure the reported gas savings

I reviewed the public repository behind the final report, including the v2.0.0 tag that predates this June report.

The local development environment, templates, exports, dashboard and Docker workflow may all be useful deliverables. However, the central performance claim has a deeper problem than the absence of raw benchmark files:

The current profiling route does not deploy and execute the paired contracts to measure their gas use. It reproduces a configured Rust-versus-Solidity estimate table and then presents the derived result as a contract profile.

That distinction changes the status of the reported 32.6% execution saving and 26.7% TCO saving.

1. What the visible workflow suggests

The final report says that the gas profiling system:

  • deploys Rust and Solidity contracts side by side;
  • supports local, Sepolia and mainnet environments;
  • produces verified gas savings;
  • tracks those results historically in the dashboard.

The README is even more explicit:

“side-by-side Rust vs Solidity comparison with exact numbers, not estimates”

That creates a clear measurement expectation:

paired source contracts
→ successful compilation
→ deployment on a defined network state
→ equivalent operations and inputs
→ actual execution
→ transaction receipts / traces
→ measured gas comparison
→ reproducible KPI

2. What the current code actually does

The public v2.0.0 route is different:

profile command
→ compile Rust and Solidity
→ create GasProfiler
→ query network name and block number
→ always enter estimation mode
→ load fixed language-level operation values
→ compare those constants
→ save/export/display the result

The decisive line is in:

src/profiler/gas-profiler.ts

// Always use estimation mode (no actual deployment needed)

After the RPC/network check, profileContract() does not deploy either contract and does not execute its functions. It calls:

estimateDeploymentGas(compilation)
estimateFunctionGas(compilation)

The _testCases parameter is not used. The ABI, actual functions, input values, storage state and resulting state transitions do not determine the function-level result.

Instead, estimateFunctionGas() reads this table from:

src/config/constants.ts

Rust:
read      5,000
write    12,000
compute   8,000
oracle   75,000

Solidity:
read      6,000
write    20,000
compute  15,000
oracle  103,000

These are exactly the figures displayed in the README and repeated in the final report:

  • reads: 16.67%;
  • writes: 40%;
  • compute: 46.67%;
  • oracle: 27.18%.

The reported 32.63% is then produced by arithmetically averaging those four percentage differences in:

src/profiler/comparator.ts

The TCO result is also derived from the configured estimates. The comparator assumes 100 executions for each generic operation, adds formula-based deployment estimates and calculates the percentage difference. It is not reconstructing an observed workload.

So the central number is not the output of a benchmark that independently confirmed the KPI. It is the output of the assumptions already encoded in the tool.

3. Why the problem is easy to miss

The network connection succeeds, and the profile can retain a real network name and block number.

That creates an observer conflict:

visible profile:
contract + network + block + timestamp + precise gas table

actual evidence path:
network metadata + static per-language constants

The RPC connection provides context, but it does not turn an estimate into an execution measurement.

A dashboard can then store these results, display trend lines, calculate historical averages and export polished JSON/CSV/HTML reports. But historical repetition of the same configured model is not independent empirical confirmation.

Precision of presentation is not provenance of measurement.

4. A failed Rust build can still produce a successful profile

There is a second boundary problem in:

src/commands/profile.ts

If Rust compilation fails, the command creates a synthetic successful compilation result using an assumed ~20 KB WASM artifact:

success: true
bytecode: '00'.repeat(estimatedWasmSize)
warnings: ['Static estimation mode — Rust compilation unavailable']

The synthetic result is then passed into the same comparison route and the command can finish with:

Gas profiling complete!

An estimate mode may legitimately provide a rough reference when a toolchain is unavailable. But it cannot share the same success semantics as a measured benchmark.

For a measured result, the invariant must be:

No successful build → no deployable artifact → no measured profile.

5. There is no implemented statistical benchmark layer

The repository contains a benchmark command, but the command currently states that the feature is still in development. Multiple iterations, statistical analysis, performance metrics and advanced visualization are listed as planned features:

src/commands/benchmark.ts

That means the repository does not currently show the repeated execution layer needed to support claims about consistency, variance or network-condition sensitivity.

This matters because a defensible Rust-versus-Solidity comparison must control at least:

  • semantic equivalence of the paired operations;
  • input vectors;
  • pre-state and post-state;
  • cold versus warm storage/access conditions;
  • calldata size;
  • contract activation and deployment treatment;
  • compiler and toolchain versions;
  • node/Nitro/Stylus version;
  • chain or fork state;
  • repetitions and dispersion;
  • failed and reverted executions.

6. The current result is contract-insensitive at the function layer

Under the present route, two entirely different Rust contracts receive the same generic:

read / write / compute / oracle

table.

Two entirely different Solidity contracts receive the same corresponding Solidity table.

Changing the business logic, storage layout, branching, host calls, calldata or number of operations does not change those four function estimates. Only the language selects the table.

That is the hidden architectural break:

The output is presented as a profile of the selected contract, while the function-level values are properties of the configured language label.

The selected contract is therefore not causally bound to the primary KPI.

7. The correct fix is to separate two legitimate products

The estimation functionality does not need to be deleted. It needs a separate identity and evidence class.

A. ESTIMATE_REFERENCE

Purpose:

  • rough planning;
  • offline comparison;
  • illustrative defaults;
  • early developer guidance.

Requirements:

  • explicit measurement_kind: estimate;
  • identify the model/config version;
  • expose every assumption;
  • do not label the output “verified” or “exact measured gas”;
  • do not use it to close a benchmark KPI;
  • do not allow network metadata to imply that execution occurred.

B. MEASURED_BENCHMARK

Purpose:

  • empirical Rust-versus-Solidity comparison;
  • contract-specific profiling;
  • grant/KPI verification;
  • historical performance tracking.

Required route:

exact Rust source + exact Solidity source
→ semantic-operation mapping
→ successful reproducible builds
→ artifact hashes
→ deploy both artifacts to the same frozen environment
→ establish equivalent pre-state
→ execute the same input vectors
→ collect receipts, traces and Stylus-specific execution data
→ verify equivalent post-state
→ repeat runs
→ report distributions and provenance

The two modes must never be merged into one trend series or one average.

8. Minimum evidence object for every measured comparison

A measured result should retain at least:

benchmark_id
measurement_kind
source commit(s)
Rust source hash
Solidity source hash
compiler/toolchain versions
node/Nitro/Stylus versions
chain ID
fork or block reference
deployed addresses
deployment transaction hashes
artifact hashes
semantic operation ID
input vector
pre-state hash
transaction hash
receipt gasUsed
trace / execution evidence
post-state hash
equivalence assertion
run index
failure/revert status

Without this binding, the result cannot answer the most important question:

Did these numbers come from these exact contracts performing the same operation under the same conditions?

9. Concrete code-level changes

I would make the correction at the architecture boundary rather than patching the displayed percentages.

  1. Add an explicit mode to profileContract():
estimate | measured
  1. In measured mode, require:
  • successful compilation;
  • real artifacts;
  • a funded authorized signer;
  • deployment receipts;
  • declared semantic test cases;
  • actual execution receipts;
  • state-equivalence assertions.
  1. Remove the synthetic successful Rust build from the measured path. A failed build must fail the measured run.

  2. Keep GAS_FUNCTION_ESTIMATES only as a versioned reference model. Do not use it in the default contract-profiling route.

  3. Implement the currently missing benchmark layer with repeated trials and statistical outputs.

  4. Add provenance to every saved profile and export.

  5. Make the dashboard visibly separate:

REFERENCE ESTIMATES
MEASURED EXECUTIONS
  1. Prevent KPI, historical-average and TCO calculations from mixing those classes.

  2. Rename existing historical outputs as estimates unless transaction-level evidence exists.

10. Acceptance tests that would close the issue

A corrected release should pass at least these tests:

  1. Contract sensitivity
    Two contracts in the same language with materially different logic must not automatically receive the same measured function table.

  2. No-network boundary
    An unavailable node may produce an estimate, but never a measured or verified result.

  3. Build boundary
    Failed Rust compilation must make a measured benchmark fail.

  4. Execution provenance
    Every measured function result must resolve to a transaction receipt or equivalent execution evidence.

  5. Semantic equivalence
    Rust and Solidity operations must produce equivalent declared post-state before their gas values are compared.

  6. Mutation test
    A meaningful code mutation must either alter the measured result or be accompanied by evidence explaining why execution remained equivalent.

  7. Repeated-run statistics
    Results should include sample count, median, min/max and dispersion rather than a single configured value.

  8. Mode isolation
    Estimate and measured records must never be aggregated into the same KPI or trend.

  9. Reproducible environment
    Another reviewer must be able to recreate the exact benchmark from the saved package without relying on undocumented local state.

Conclusion

This is not primarily a request for more documentation.

It is a measurement-identity correction.

The toolkit may still be a useful local Stylus development environment. But based on the public v2.0.0 execution route, the central gas-savings KPI should currently be classified as:

model-derived estimate, not verified contract execution measurement

until a transaction-bound benchmark package demonstrates otherwise.

The important next milestone is therefore not to defend the existing 32.6% figure. It is to turn the profiler from a configured benchmark-table renderer into an evidence-producing measurement system.

Once that boundary is corrected, the dashboard, exports and historical tracking become genuinely valuable because every number will be bound to the contract, operation, state and execution that produced it.