Skip to content

fix(web): validate vesting timestamp ordering before submission - #139

Merged
dev-jodee merged 1 commit into
solana-foundation:mainfrom
Anti83:fix-web-vesting-validation
Oct 5, 2026
Merged

dev-jodee merged 1 commit into
solana-foundation:mainfrom
Anti83:fix-web-vesting-validation

Conversation

@Anti83

@Anti83 Anti83 commented Oct 1, 2026

Copy link
Copy Markdown
Contributor

The web form currently accepts schedules that VestingSchedule::validate rejects on-chain. For example, Linear start=200/end=100 and CliffLinear start=100/cliff=201/end=200 both return ok: true from buildVestingSchedule, so users only learn about the invalid dates when the transaction fails.

Align the form builder with the program's existing rules:

  • Linear and CliffLinear: end must be strictly after start.
  • Cliff: timestamp must be positive.
  • CliffLinear: cliff must be within the inclusive start/end interval.

Return actionable validation errors before building the instruction and reuse the parsed bigint timestamps.

Validation: ran a focused local Node harness against the actual helper/validation/builder source, using Node's TypeScript stripping. All 15 cases pass (7 passed before this change): valid schedules, reversed/equal intervals, non-positive Cliff dates, out-of-range cliffs, inclusive cliff boundaries, and malformed integer input. Also checked bigint output and git diff --check. Full application build/typecheck was not run.

This change was prepared with AI assistance.

@Anti83
Anti83 requested a review from dev-jodee as a code owner October 1, 2026 21:41
@vercel

vercel Bot commented Oct 1, 2026

Copy link
Copy Markdown

@Anti83 is attempting to deploy a commit to the Solana Foundation Team on Vercel.

A member of the Team first needs to authorize it.

@vercel

vercel Bot commented Oct 5, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
solana-rewards-program Ready Ready Preview Oct 5, 2026 3:01pm UTC

Request Review

@dev-jodee
dev-jodee merged commit 0b1bf17 into solana-foundation:main Oct 5, 2026
13 checks passed
@dev-jodee

Copy link
Copy Markdown
Collaborator

thanks @Anti83

This branch was successfully deployed

1 active deployment
Preview — cc348805 Deployed Oct 5, 2026 by vercel[bot]
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