Skip to content

docs: benchmark and document storage cost delta from weighted governance - #547

Merged
thegreatfeez merged 1 commit into
Ac0rdP:mainfrom
Meet-hybrid:docs/benchmark-storage-cost-delta-weighted-governance
Aug 31, 2026
Merged

docs: benchmark and document storage cost delta from weighted governance#547
thegreatfeez merged 1 commit into
Ac0rdP:mainfrom
Meet-hybrid:docs/benchmark-storage-cost-delta-weighted-governance

Conversation

@Meet-hybrid

Copy link
Copy Markdown
Contributor

Overview

This PR benchmarks the real byte-size impact of weighted governance on on-chain storage and brings ARCHITECTURE.md back in sync with the deployed contract. The storage cost tables still described the pre-weighted layout (Vec<Address> owners, bool approvals, no quorum_weight); this update corrects all tables, adds measured XDR byte breakdowns, and presents a clear before/after cost comparison.

Related Issue

Closes #351

Changes

📊 Storage Table Corrections

  • [MODIFY] docs/ARCHITECTURE.md — Persistent Storage table: OWNERS type changed from Vec<Address> to Map<Address,u32>, ("APPR", id, owner) type changed from bool to u32
  • [ADD] docs/ARCHITECTURE.mdTWGT added to Key Naming Conventions singleton keys table

📐 Measured XDR Byte Breakdowns

  • [ADD] docs/ARCHITECTURE.mdOWNERS entry measured at 1, 7, and 20 owners (52 / 316 / 808 bytes)
  • [ADD] docs/ARCHITECTURE.md("APPR", id, owner) weighted entry breakdown (~144 bytes, u32 value)
  • [MODIFY] docs/ARCHITECTURE.md — Proposal entry corrected: thresholdquorum_weight, added approval_weight field, corrected Address and String byte counts

📈 Before/After Cost Delta

  • [ADD] docs/ARCHITECTURE.md — Storage Cost Delta section with pre-weighted vs post-weighted comparison table
  • [ADD] docs/ARCHITECTURE.md — Worst-case persistent entries count (1,051 entries, ~54.6 XLM per 30-day cycle — identical before and after)

Verification Results

git diff --check       ✅ Passed
Documentation review   ✅ Tables align with lib.rs Proposal struct and storage keys

Acceptance Criteria

Criteria Status
Storage tables list every current key including TWGT ✅ Instance Storage and Key Naming tables updated
Proposal Struct Fields matches lib.rs definition ✅ Corrected quorum_weight, added approval_weight
Measured byte sizes for OWNERS and ("PROP", id) entries ✅ 1/7/20 owner counts measured; proposal entry measured
Before/after cost comparison present ✅ Storage Cost Delta section with XLM and byte-level comparison
Worst-case total recalculated ✅ 50 proposals × 20 owners = 1,051 entries at ~54.6 XLM

Updates ARCHITECTURE.md storage tables and cost analysis to reflect
the weighted governance model that replaced the flat M-of-N approval
count. Measures actual XDR byte sizes for the Map<Address, u32> OWNERS
entry, the u32-based approval weight entry, and the expanded Proposal
struct, then presents a clear before/after cost comparison.

Changes:
- Updated Persistent Storage table: OWNERS type Vec<Address> → Map<Address, u32>, APPR type bool → u32
- Added TWGT to Key Naming Conventions singleton keys table
- Added measured XDR byte breakdowns for OWNERS (1/7/20 owners), approval weight, and proposal entries
- Added Storage Cost Delta section with before/after comparison
- Corrected Proposal entry field names (threshold → quorum_weight, added approval_weight)

Closes Ac0rdP#351
@vercel

vercel Bot commented Aug 31, 2026

Copy link
Copy Markdown

@Meet-hybrid is attempting to deploy a commit to the thegreatfeez's projects Team on Vercel.

A member of the Team first needs to authorize it.

@drips-wave

drips-wave Bot commented Aug 31, 2026

Copy link
Copy Markdown

@Meet-hybrid 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

@thegreatfeez
thegreatfeez merged commit f2c1245 into Ac0rdP:main Aug 31, 2026
1 check failed
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.

Benchmark and document the storage cost delta from weighted governance in ARCHITECTURE.md

2 participants