privacy-scaling-explorations / maci-rpgf

EasyRetroPGF with MACI
https://maci-rpgf.vercel.app
MIT License
6 stars 4 forks source link

Inconsistently generating MACI keypairs #75

Closed samajammin closed 2 months ago

samajammin commented 2 months ago

After connecting with a wallet which I've already registered in MACI with, I am prompted to "sign up" in the UI. When I try to "sign up", the UI throws an error toast notification (seemingly because the tx would revert).

This appears to mean that we're not generating deterministic MACI keys based off the ETH address? Here's the address I was using: 0x1b6ec1327e70075CC43EDF08c5F8230A91d9a98f


Round has completed

  1. I navigate to Stats page (https://maci-rpgf.vercel.app/stats)
  2. I click "Sign up"
  3. Error toast pops

Solution: I think we should just not display the "Sign up" prompt if the round is already over

Video: https://github.com/privacy-scaling-explorations/maci-rpgf/assets/8097623/8985e492-9feb-4efd-a1da-905f03cc1e76

Screenshot: Image 2024-04-26 at 13 34 40

Console errors:

VM43:1 MetaMask - RPC Error: Internal JSON-RPC error. {code: -32603, message: 'Internal JSON-RPC error.', data: {…}}code: -32603data: {code: 3, message: 'execution reverted', data: '0x3a81d6fc', cause: null}message: "Internal JSON-RPC error."[[Prototype]]: Object
(anonymous) @ VM43:1
(anonymous) @ VM43:1
(anonymous) @ VM43:1
(anonymous) @ VM43:1
m @ VM43:1
p @ VM43:1
(anonymous) @ VM43:1
s @ VM43:1
Promise.then (async)
u @ VM43:1
(anonymous) @ VM43:1
m @ VM43:1
d @ VM43:1
(anonymous) @ VM43:1
(anonymous) @ VM43:1
m @ VM43:1
c @ VM43:1
handle @ VM43:1
_rpcRequest @ VM43:1
(anonymous) @ VM43:1
request @ VM43:1
#U @ _app-3c0f77d989df5d48.js:312
_send @ _app-3c0f77d989df5d48.js:312
(anonymous) @ _app-3c0f77d989df5d48.js:312
(anonymous) @ _app-3c0f77d989df5d48.js:312
setTimeout (async)
#e7 @ _app-3c0f77d989df5d48.js:312
send @ _app-3c0f77d989df5d48.js:312
send @ _app-3c0f77d989df5d48.js:312
await in send (async)
_perform @ _app-3c0f77d989df5d48.js:312
#eV @ _app-3c0f77d989df5d48.js:312
estimateGas @ _app-3c0f77d989df5d48.js:312
(anonymous) @ _app-3c0f77d989df5d48.js:312
sendUncheckedTransaction @ _app-3c0f77d989df5d48.js:312
sendTransaction @ _app-3c0f77d989df5d48.js:312
await in sendTransaction (async)
b @ _app-3c0f77d989df5d48.js:445
await in b (async)
signUp @ _app-3c0f77d989df5d48.js:445
i @ _app-3c0f77d989df5d48.js:299
await in i (async)
(anonymous) @ _app-3c0f77d989df5d48.js:312
(anonymous) @ 4617-1df04db64fe694a5.js:1
eU @ framework-e182ded6da661f6f.js:9
eH @ framework-e182ded6da661f6f.js:9
(anonymous) @ framework-e182ded6da661f6f.js:9
re @ framework-e182ded6da661f6f.js:9
rn @ framework-e182ded6da661f6f.js:9
(anonymous) @ framework-e182ded6da661f6f.js:9
oN @ framework-e182ded6da661f6f.js:9
eF @ framework-e182ded6da661f6f.js:9
ro @ framework-e182ded6da661f6f.js:9
nU @ framework-e182ded6da661f6f.js:9
nD @ framework-e182ded6da661f6f.js:9
_app-3c0f77d989df5d48.js:312 error happened: Error: [✗] execution reverted (unknown custom error) (action="estimateGas", data="0x3a81d6fc", reason=null, transaction={ "data": "0x3364120a1f3cd28b39fef1a0c2682dc5cc235a4b124512b30cd48581ba207c5aa78f64451116c1f9eab4c8047f5ab1d0dd8718143866a7e64fab541d1c5683934d7e43f1000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000000209029ce84bc4836aa74e6a61508436818dc00082897aa98abe303ae374d96885400000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000", "from": "0x1b6ec1327e70075CC43EDF08c5F8230A91d9a98f", "to": "0xD18Ca45b6cC1f409380731C40551BD66932046c3" }, invocation=null, revert=null, code=CALL_EXCEPTION, version=6.12.0)
samajammin commented 2 months ago

Same issue when on /projects page: https://share.zight.com/OAuZRoj1

samajammin commented 2 months ago
error happened: Error: [✗] execution reverted (unknown custom error) (action="estimateGas", data="0x3a81d6fc", reason=null, transaction={ "data": "0x3364120a02e1658b423f31c5de9a4e4c239a3f6a47bf0fbd917028f9cb472f3665d779e11c67b370d7f43461865ecc88a5d59c9275e0d4f3f3201bf9cdf128e48a6b9b95000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000000209029ce84bc4836aa74e6a61508436818dc00082897aa98abe303ae374d96885400000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000", "from": "0x1b6ec1327e70075CC43EDF08c5F8230A91d9a98f", "to": "0xD18Ca45b6cC1f409380731C40551BD66932046c3" }, invocation=null, revert=null, code=CALL_EXCEPTION, version=6.12.0)
ctrlc03 commented 2 months ago

tx: https://sepolia-optimism.etherscan.io/tx/0x2628fe0315afd8c569d078be32092d9b8e360267a61b11204e2b96968f8bab3a key:

kittybest commented 2 months ago

tried in my local side, generated 1st keypair: data keys: macipk.1666289259b948bd07f396842c5883704ad27ea474898b9f8d3f62cb9f70d4e0 macisk.24d7938e9a540318f509e3f71efa803661db4b677d5cc37e6aeea1248bb81c97

generated 2nd keypair: data keys: macipk.11f45f35de7bf0628938da7be63783b66bb5d4e9c71da188e967d6c284a3b368 macisk.1376fc3792d73ad823edf1b85bbed0d9788ac1bac200070e49294bc41c8a0dd4

What I did

  1. connect to my wallet
  2. print out the keypair (1st keypair ⬆️)
  3. disconnect my wallet and clear everything in cache
  4. re-connect to my wallet
  5. print out the keypair (2nd keypair ⬆️)
crisgarner commented 2 months ago

I Had the same issue when deploying the round with Vercel, did a sign-up locally, and then on the deployed site requested another sign up, which didn't let me.

image

ctrlc03 commented 2 months ago

I Had the same issue when deploying the round with Vercel, did a sign-up locally, and then on the deployed site requested another sign up, which didn't let me.

image

It is expected that keys do not work when signing up locally vs on vercel, as they depend on the signature, and the message you sign has the URL of the domain you are accessing This error also looks kinda unrelated to a signup failure, it's complaining about trying to fetch > 2k blocks at a time 🤔

ctrlc03 commented 2 months ago

The reason why keys are different is because of this line https://github.com/privacy-scaling-explorations/maci-rpgf/blob/main/src/providers/RainbowKitSiweNextAuthProvider.tsx#L44 -> looks like the nonce is the csrf token which is not a static value