gitcoinco / easy-retro-pgf

Retroactive Public Goods Funding for everyone.
https://easyretropgf.xyz
MIT License
54 stars 29 forks source link

Error submitting ballot - Votes hash mismatch #15

Open samajammin opened 7 months ago

samajammin commented 7 months ago

Tried submitting a ballot, received this error: Image 2024-01-29 at 13 50 25


context
: 
{}
elapsedMs
: 
322
input
: 
{signature: '0xb471858b73e7364e890dc1c0c35c22dd089ab3c01b8784a7…3d3f02408ef9851dc2ee06661821225a000393aa81870c81b', message: {…}, chainId: 420}
result
: 
TRPCClientError: Votes hash mismatch at u.from (https://easy-retro-pgf.vercel.app/_next/static/chunks/pages/_app-71854ee0ad1f082d.js:1361:202769) at https://easy-retro-pgf.vercel.app/_next/static/chunks/pages/_app-71854ee0ad1f082d.js:1361:206666
data
: 
{code: 'BAD_REQUEST', httpStatus: 400, path: 'ballot.publish', zodError: null}
meta
: 
{response: Response, responseJSON: Array(1)}
name
: 
"TRPCClientError"
shape
: 
{message: 'Votes hash mismatch', code: -32600, data: {…}}
cause
: 
undefined
message
: 
"Votes hash mismatch"
stack
: 
"TRPCClientError: Votes hash mismatch\n    at u.from (https://easy-retro-pgf.vercel.app/_next/static/chunks/pages/_app-71854ee0ad1f082d.js:1361:202769)\n    at https://easy-retro-pgf.vercel.app/_next/static/chunks/pages/_app-71854ee0ad1f082d.js:1361:206666"
[[Prototype]]
: 
Error
[[Prototype]]
: 
Object

POST https://easy-retro-pgf.vercel.app/api/trpc/ballot.publish?batch=1 400 (Bad Request)

error: {json: {message: "Votes hash mismatch", code: -32600,…}}

Not sure if this is a related issue to #13 with the TRPC?

samajammin commented 7 months ago

Ah, I'm guessing this might be because my address is not a badgeholder. Is that correct?

https://github.com/privacy-scaling-explorations/maci-rpgf/blob/main/docs/03_creating_badgeholders.md

carlbarrdahl commented 7 months ago

It's checking if you're a badgeholder before this error is thrown. It occurs when signature of the ballot doesn't match the store ballot for the user. Not exactly sure why this is happening. It's also mentioned in #6. https://github.com/gitcoinco/easy-retro-pgf/blob/fb4e97177b3e311881c830b769f3206ffa9b417c/src/server/api/routers/ballot.ts#L76-L93