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

feat: add deployer service #271

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

feat: add deployer service #271

wants to merge 1 commit into from

Conversation

ctrlc03
Copy link
Collaborator

@ctrlc03 ctrlc03 commented Aug 20, 2024

Implement a Deployer service on the coordinator service

Note: seems like when deploying the poseidon libraries they don't work, so for now I would just use the already deployed ones which we have on all chains. End of the day we should encourage re-use of those.

fix #61
fix #267

  • e2e tests
  • endpoint to deploy MACI contracts
  • endpoint to deploy Poll contracts
  • tests
  • custom link libraries to bytecode
  • send via kernel client
  • use session keys to generate kernel client
  • customisable configuration for deployment
  • custom errors
  • do not deploy contracts that have already been deployed with same arguments (e.g. no need to deploy another constant voice credit proxy with 100 credits if there's already one out there)

Copy link

vercel bot commented Aug 20, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
maci-platform ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 17, 2024 6:06am

@ctrlc03 ctrlc03 self-assigned this Aug 20, 2024
@ctrlc03 ctrlc03 force-pushed the feat/deployer-service-aa branch 3 times, most recently from 4136506 to 18700bd Compare August 24, 2024 10:51
@ctrlc03 ctrlc03 force-pushed the feat/deployer-service-aa branch 2 times, most recently from c95520e to d073ad6 Compare August 26, 2024 21:08
@ctrlc03 ctrlc03 marked this pull request as ready for review August 26, 2024 21:09
@ctrlc03 ctrlc03 added the enhancement New feature or request label Aug 26, 2024
Copy link
Collaborator

@0xmad 0xmad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ctrlc03 thanks, just some comments

.github/scripts/deploy.sh Outdated Show resolved Hide resolved
@ctrlc03 ctrlc03 force-pushed the feat/deployer-service-aa branch 2 times, most recently from 58e8f0d to 5751832 Compare September 13, 2024 12:10
@ctrlc03 ctrlc03 force-pushed the feat/deployer-service-aa branch 2 times, most recently from 95e0cbb to 343da9f Compare September 13, 2024 12:35
@ctrlc03 ctrlc03 force-pushed the feat/deployer-service-aa branch 2 times, most recently from cba9d37 to b19e0d4 Compare September 13, 2024 12:57
@ctrlc03 ctrlc03 requested a review from 0xmad September 13, 2024 13:18
packages/coordinator/.env.example Outdated Show resolved Hide resolved
packages/coordinator/ts/deployer/deployer.service.ts Outdated Show resolved Hide resolved
packages/coordinator/ts/deployer/deployer.service.ts Outdated Show resolved Hide resolved
packages/coordinator/ts/deployer/deployer.service.ts Outdated Show resolved Hide resolved
Comment on lines +633 to +628
// @ts-expect-error - the abi has a more complex type for the processZkeys and tallyZkeys
processZkeys,
// @ts-expect-error - the abi has a more complex type for the processZkeys and tallyZkeys
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will the explicit cast work here? For example: processZkeys: processZkeys as unknown as bigint[]

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it wants this type: readonly { alpha1: { x: bigint; y: bigint; }; beta2: { x: readonly [bigint, bigint]; y: readonly [bigint, bigint]; }; gamma2: { x: readonly [bigint, bigint]; y: readonly [bigint, bigint]; }; delta2: { x: readonly [bigint, bigint]; y: readonly [bigint, bigint]; }; ic: readonly { ...; }[]; }[]

Copy link
Collaborator

@0xmad 0xmad Sep 16, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, maybe it can be cast to G2Point[]?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that wasn't working either

packages/coordinator/ts/deployer/deployer.service.ts Outdated Show resolved Hide resolved
Comment on lines +667 to +662
// @ts-expect-error - the abi has a more complex type for the processZkeys and tallyZkeys
processZkeys,
// @ts-expect-error - the abi has a more complex type for the processZkeys and tallyZkeys
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's try cast here too

packages/coordinator/ts/common/accountAbstraction.ts Outdated Show resolved Hide resolved
packages/coordinator/ts/common/accountAbstraction.ts Outdated Show resolved Hide resolved
packages/coordinator/package.json Outdated Show resolved Hide resolved
Copy link
Contributor

@kittybest kittybest left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot! it's a quite large PR

packages/coordinator/package.json Outdated Show resolved Hide resolved
packages/coordinator/ts/common/accountAbstraction.ts Outdated Show resolved Hide resolved
packages/coordinator/ts/deployer/deployer.controller.ts Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: In Progress
Development

Successfully merging this pull request may close these issues.

feat: implement deployer service on coordinator service Support poll deploy command api
3 participants