Skip to content

feat(tooling): contract state export, migration & dependency analysis (#496, #497, #499)#545

Merged
Smartdevs17 merged 1 commit into
Smartdevs17:mainfrom
Itodo-S:feat/contract-tooling-suite-496-497-499
Jun 27, 2026
Merged

feat(tooling): contract state export, migration & dependency analysis (#496, #497, #499)#545
Smartdevs17 merged 1 commit into
Smartdevs17:mainfrom
Itodo-S:feat/contract-tooling-suite-496-497-499

Conversation

@Itodo-S

@Itodo-S Itodo-S commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

Adds a cohesive contract-lifecycle tooling suite under scripts/, resolving three related issues in one PR. Each tool is a dependency-free TypeScript CLI (runs on Node ≥ 22 via --experimental-strip-types, matching the repo's scripts/ TS convention) with a pure, unit-tested core.

#499 — State Exporter (scripts/state-exporter/)

  • Exports user positions (collateral/debt/health factor), pool configs, and governance to JSON & CSV.
  • Full snapshot + incremental change-data-capture (delta vs a previous snapshot).
  • Verifiable: every export carries a manifest with SHA-256 checksum + per-section row counts, plus a --verify integrity command.
  • gzip compression; pluggable StateSource (file source by default → runnable offline).

#497 — State Migration Tool (scripts/state-migrate/)

  • Declarative migrations: addField / removeField / renameField / transformField.
  • Dry-run (never mutates), atomic checkpoint rollback on op error or failed verification, post-migration integrity checks, versioned audit history (monotonic-version enforced), heuristic per-op cost estimate, CLI.

#496 — Dependency Analyzer (scripts/dependency-analyzer/)

  • Scans the Rust/Soroban workspace and builds a dependency graph (call / import / library edges).
  • Upgrade-impact: transitive dependents + risk level for a given contract; cycle detection.
  • Output: Graphviz DOT + JSON. Verified against the real workspace (28 crates, 24 edges).

Testing

node --experimental-strip-types --test \
  scripts/state-exporter/exporter.test.ts \
  scripts/state-migrate/migrator.test.ts \
  scripts/dependency-analyzer/analyzer.test.ts
# 29 passing

Each tool has a README documenting its covered acceptance criteria.

Scope note

These are large (200-point) issues. This PR delivers a working, tested core for each in the prescribed paths; the heavier infra portions are intentionally left as documented follow-ups (each README lists them): live Soroban RPC source, Parquet/SQL + S3/GCS sinks and scheduled workers (#499); on-chain atomic execution + real gas metering (#497); interactive D3.js web dashboard + CI auto-generation (#496). Happy to follow up on any of these.

Closes #496
Closes #497
Closes #499

…sis (Smartdevs17#496, Smartdevs17#497, Smartdevs17#499)

Adds a cohesive contract-lifecycle tooling suite under scripts/, each a
dependency-free TypeScript CLI (runs on Node >= 22 via --experimental-strip-types)
with a pure, unit-tested core.

Smartdevs17#499 — scripts/state-exporter/
- Export user positions, pool configs, and governance to JSON/CSV.
- Full snapshot + incremental change-data-capture (diff vs previous snapshot).
- Verifiable: SHA-256 checksum + row-count manifest, integrity check command.
- gzip compression. Pluggable StateSource (file source by default).

Smartdevs17#497 — scripts/state-migrate/
- Declarative schema migrations: add/rename/remove/transform field.
- Dry-run (never mutates), atomic checkpoint rollback on op error or failed
  verification, post-migration integrity checks, monotonic versioned history,
  heuristic per-op cost estimate, CLI.

Smartdevs17#496 — scripts/dependency-analyzer/
- Scans the Rust/Soroban workspace, builds a contract dependency graph
  (call / import / library edges), transitive upgrade-impact + risk level,
  cycle detection, Graphviz DOT + JSON output. Verified against the real
  workspace (28 crates).

Tests: 29 passing across the three cores
  node --experimental-strip-types --test scripts/**/**.test.ts

Each tool's README documents covered acceptance criteria and the heavier
infra follow-ups intentionally left out of this core (live RPC source,
Parquet/SQL, S3/GCS, scheduling; on-chain gas metering; interactive D3
dashboard + CI wiring).
@vercel

vercel Bot commented Jun 26, 2026

Copy link
Copy Markdown

@Itodo-S is attempting to deploy a commit to the smartdevs17's projects Team on Vercel.

A member of the Team first needs to authorize it.

@drips-wave

drips-wave Bot commented Jun 26, 2026

Copy link
Copy Markdown

@Itodo-S Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@Smartdevs17 Smartdevs17 merged commit 4871999 into Smartdevs17:main Jun 27, 2026
4 of 12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants