Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplify circuit parameter configuration by always deriving MaxValues and BatchSizes from TreeDepths #1066

Closed
1 task done
yuetloo opened this issue Jan 19, 2024 · 0 comments · Fixed by #1089
Closed
1 task done
Assignees

Comments

@yuetloo
Copy link
Contributor

yuetloo commented Jan 19, 2024

Prerequisites

Please answer the following question for yourself before submitting a feature request.

  • I checked to make sure that this request has not already been filed

Motivation

Currently, to use these circuits from the ceremony,

tallyVotes_6-2-3
processMessage_6-8-2-3

applications (e.g clr.fund) have to pass the derivable data

  1. MaxValues to maci.deployPoll()
  2. messageBatchSize to VKRegistry

Change request:

  1. remove MaxValues from deployPoll() interface and let MACI calculate it
  2. replace messageBatchSize with messageTreeSubDepth in VKRegistry and MessageProcessor

The intent is to minimize inconsistency and error in applications passing the wrong messageBatchSize or MaxValues to MACI.

  function deployPoll(
    uint256 _duration,
    MaxValues memory _maxValues,
    TreeDepths memory _treeDepths,
    PubKey memory _coordinatorPubKey,
    address _verifier,
    address _vkRegistry,
    bool useSubsidy
  ) 

  function setVerifyingKeys(
    uint256 _stateTreeDepth,
    uint256 _intStateTreeDepth,
    uint256 _messageTreeDepth,
    uint256 _voteOptionTreeDepth,
    uint256 _messageBatchSize,
    VerifyingKey calldata _processVk,
    VerifyingKey calldata _tallyVk
  )

Details

Please describe your feature request in detail.

Make sure that you have reviewed MACI's Contributor Guidelines

@ctrlc03 ctrlc03 self-assigned this Jan 23, 2024
ctrlc03 added a commit that referenced this issue Jan 23, 2024
…ead calculate

Simplify logic and save gas by computing maxValues within MACI vs passing as parameter to
deployPoll.

fix #1066
ctrlc03 added a commit that referenced this issue Jan 23, 2024
…ead calculate

Simplify logic and save gas by computing maxValues within MACI vs passing as parameter to
deployPoll.

fix #1066
ctrlc03 added a commit that referenced this issue Jan 24, 2024
…ead calculate

Simplify logic and save gas by computing maxValues within MACI vs passing as parameter to
deployPoll.

fix #1066
@ctrlc03 ctrlc03 added this to MACI Jan 24, 2024
@ctrlc03 ctrlc03 moved this to In Progress in MACI Jan 24, 2024
ctrlc03 added a commit that referenced this issue Jan 24, 2024
…Poll() and instead calculate

Simplify logic and save gas by computing maxValues within MACI vs passing as parameter to
deployPoll. Also remove batchSizes and compute within the smart
contracts, as well as remove large number of calls to the poll contract,
and instead pass parameters around functions.

fix #1066
ctrlc03 added a commit that referenced this issue Jan 24, 2024
…Poll() and instead calculate

Simplify logic and save gas by computing maxValues within MACI vs passing as parameter to
deployPoll. Also remove batchSizes and compute within the smart
contracts, as well as remove large number of calls to the poll contract,
and instead pass parameters around functions.

fix #1066
ctrlc03 added a commit that referenced this issue Jan 24, 2024
…Poll() and instead calculate

Simplify logic and save gas by computing maxValues within MACI vs passing as parameter to
deployPoll. Also remove batchSizes and compute within the smart
contracts, as well as remove large number of calls to the poll contract,
and instead pass parameters around functions.

fix #1066
@github-project-automation github-project-automation bot moved this from In Progress to Done in MACI Jan 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
2 participants