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

Error submitting ballot - Votes hash mismatch #15

Open
samajammin opened this issue Jan 29, 2024 · 2 comments
Open

Error submitting ballot - Votes hash mismatch #15

samajammin opened this issue Jan 29, 2024 · 2 comments

Comments

@samajammin
Copy link
Contributor

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
Copy link
Contributor Author

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
Copy link
Contributor

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.

if (!(await fetchApprovedVoter(voterId))) {
throw new TRPCError({
code: "UNAUTHORIZED",
message: "Voter is not approved",
});
}
if (
!(await verifyBallotHash(
input.message.hashed_votes,
ballot.votes as Vote[],
))
) {
throw new TRPCError({
code: "BAD_REQUEST",
message: "Votes hash mismatch",
});
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants