Skip to content

fix(api): reject non-canonical vote addresses#395

Open
altergui wants to merge 1 commit intomainfrom
various-sequencer-fixes
Open

fix(api): reject non-canonical vote addresses#395
altergui wants to merge 1 commit intomainfrom
various-sequencer-fixes

Conversation

@altergui
Copy link
Copy Markdown
Contributor

@altergui altergui commented Apr 3, 2026

No description provided.

Copilot AI review requested due to automatic review settings April 3, 2026 11:37
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds validation to reject vote addresses that don't have the canonical format of exactly 20 bytes (the standard Ethereum address length), and ensures accepted addresses are canonicalized.

Changes:

  • Added length validation to ensure vote addresses are exactly 20 bytes
  • Added address canonicalization by converting through common.BytesToAddress to ensure consistency
  • Added test case to verify that non-20-byte addresses are properly rejected with a clear error message

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
api/vote.go Added validation to check address length is exactly 20 bytes and canonicalize valid addresses
api/vote_test.go Added test case verifying rejection of addresses that are not 20 bytes

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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

Successfully merging this pull request may close these issues.

2 participants