Skip to content

Add governance proposal salt to prevent vote-replay across re-submitted proposals #668

Description

@greatest0fallt1me

Description

A proposal in governance.rs is keyed by an incrementing id, but identical re-submitted payloads can be voted on by re-using off-chain signatures. Add a per-proposal salt: BytesN<32> baked into the signed vote message so signatures are bound to a specific proposal instance.

Requirements and Context

  • Generate salt at proposal creation using Env::prng
  • Include salt in canonical vote message
  • Reject signatures whose salt does not match
  • Must be secure, tested, and documented
  • Should be efficient and easy to review

Suggested Execution

  1. Fork the repo and create a branch
    git checkout -b feature/governance-vote-salt
  2. Implement changes
    • contracts/predictify-hybrid/src/governance.rs
    • contracts/predictify-hybrid/src/governance_tests.rs
  3. Test and commit
    • cargo test -p predictify-hybrid governance_salt
    • Cover edge cases
    • Include test output and notes in the PR

Example commit message

feat: bind governance vote signatures to per-proposal salt

Acceptance Criteria

  • Signature for one proposal is rejected on another with same payload
  • Salt is stored and exposed via view
  • Salt entropy comes from Env::prng, not block timestamp

Guidelines

  • Validate auth, overflow, and storage TTL/archival
  • Clear documentation and inline comments
  • Timeframe: 96 hours

Metadata

Metadata

Labels

GRANTFOX OSSGrantFox open-source campaign taskOFFICIAL CAMPAIGNOfficial GrantFox campaign issueStellar WaveIssues in the Stellar wave programrustRust implementationsecuritySecurity hardeningsmart-contractSoroban smart-contract worksorobanSoroban SDK / Stellar

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions