OpenZeppelin / OpenZeppelin/compact-contracts

dev: trim ShieldedMultiSig preset getters to a deployable set

Open
#689 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
TypeScript
Stars
55
Forks
29
Avg merge
5d 7h
Merged PRs (30d)
25

Description

Context

The ShieldedMultiSig preset's getter surface, combined with its state-changing circuits, sits at or over the local-node deploy block limit. Some getters were already dropped to fit (getProposalRecipient/getProposalAmount/getProposalColor, getReceivedMinusSent), and #673 removed the simulator wrappers that faked them so nothing masquerades as a circuit the preset does not expose.

Problem

  • The preset is undeployable / at the ceiling as circuits grow.
  • Some getters are trivial derivations that arguably should not be circuits at all: getReceivedMinusSent is just getReceivedTotal - getSentTotal.

Proposal

  • Trim the preset getter surface to the minimum needed for on-chain checks; derive the rest off-chain (the TS ledger reader / getProposal).
  • Drop getReceivedMinusSent as a circuit in the preset and the ShieldedTreasury module.
  • Once removed from the treasury module, drop the receivedMinusSent-equals-balance section in ShieldedTreasury.test.ts (kept in #673 because the module circuit still exists there).

Acceptance

  • The preset deploys on the local node within the block limit.
  • Derived values are read off-chain, not via faked circuit wrappers.

Origin

Split from #673 review (Andrew's comments on the simulator getter wrappers, https://github.com/OpenZeppelin/compact-contracts/pull/673#discussion_r3592239540 and https://github.com/OpenZeppelin/compact-contracts/pull/673#discussion_r3592280056).

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the ShieldedMultiSig preset and the ShieldedTreasury module, then inspect ShieldedTreasury.test.ts and the TS ledger reader's getProposal path. Verify which getters remain needed for on-chain checks and run the preset deployment and treasury tests. Done means the preset deploys within the local-node block limit, derived values are read off-chain, and the obsolete receivedMinusSent assertion is removed.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
blockchain, testing
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.