Skip to content

feat(at): add persistent maps and cross-AT reads - #150

Merged
QuickMythril merged 1 commit into
mainfrom
feat/at-map-storage
Jul 22, 2026
Merged

feat(at): add persistent maps and cross-AT reads#150
QuickMythril merged 1 commit into
mainfrom
feat/at-map-storage

Conversation

@QuickMythril

Copy link
Copy Markdown
Member

Summary

Adds consensus-backed persistent key/value maps for ATs, with synchronous cross-AT reads (including same-block earlier writers). This is the storage foundation for the SMPL faucet's exact deduplication.

  • Opcodes: map GET 0x0600 / SET 0x0601; contracts write only their own map, may read any AT's map.
  • Consensus safety: map writes live in a Block-owned overlay during validation (candidate validation never writes the database); they commit atomically with AT state during block processing and reverse on orphan via rollback journals.
  • Verifiability: every AT state now commits a canonical hash of its current map contents (canonical signed-key ordering), so a node's serving table is directly checkable against consensus state.
  • Pricing: creating a live entry costs 100 steps via the AT library's new platform pricing hook; reads/overwrites/deletes/no-ops/cap-rejected writes stay at the normal 10-step cost. Step cost comes from the Java default, not shipped JSON, so the live Previewnet config hash is unchanged (regression-tested: 8e655fc30e325d11ec44d350dd456ad80bff0a507935133edc3db5345e9253e5).
  • Caps & governance: 500-entry per-AT ceiling, ratcheting (dev-group governance may only raise it); chain-parameter API surface included.
  • Activation: Previewnet block 70,000; mainnet disabled.
  • Schema: repository advances to version 3 (current map rows, rollback journals, nullable map roots on AT states).

Dependency provenance

Pins com.github.QortiumDev:AT:33df17d (adds the pricing hook and fixes an unenforced platform-function precheck — see QortiumDev/AT#9, which must merge as a merge commit first so the pin stays canonical). Vendored artifact:

  • jar SHA-256 2f40ee7acfdeaa1dfc35615a6ba7870dcc4e85977d3e9e3a1b7ad6bcef340f3b
  • pom SHA-256 43f6ac5cfae6cf0f823f972c929b3d3844493cf1e510268c8369c31275eb8b4d

Design doc: docs/chain-design/at-map-storage.md. Changelog entry included.

Verification

  • AT library: 179/179 tests.
  • Core focused map/config/repository/API set: 124 tests, including exact block-70,000 boundary, same-block cross-AT reads, orphan rollback, cap ratcheting, candidate-validation-must-not-write coverage, and live config-hash preservation.
  • Core full clean suite: mvn -B clean test -DskipTests=false2,675 tests, 0 failures, 0 errors (64 expected skips).

🤖 Generated with Claude Code

@QuickMythril
QuickMythril merged commit 51c4731 into main Jul 22, 2026
9 checks passed
@QuickMythril
QuickMythril deleted the feat/at-map-storage branch July 22, 2026 01:54
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.

1 participant