Skip to content

feat(events): stop enforcing the submission deadline on-chain#99

Merged
0xdevcollins merged 1 commit into
testnetfrom
feat/remove-deadline-enforcement
Jul 23, 2026
Merged

feat(events): stop enforcing the submission deadline on-chain#99
0xdevcollins merged 1 commit into
testnetfrom
feat/remove-deadline-enforcement

Conversation

@0xdevcollins

@0xdevcollins 0xdevcollins commented Jul 23, 2026

Copy link
Copy Markdown
Collaborator

Why

The submission deadline was enforced by the contract, but it gates nothing the contract is actually responsible for — and it was immutable on-chain, so the contract couldn't support the extensions organizers do routinely.

Walking the cases (verified in code):

So a submission window — with its extensions, grace periods, cutoffs — is a backend/product concern. The chain keeps only what it must: escrow custody, the count cap, and discretionary winner selection.

Change

Remove the enforcement only:

  • delete the deadline rejection in submit, withdraw_submission, and bounty apply;
  • delete the create-time DeadlineMustBeFuture check;
  • drop the required-deadline check from hackathon/crowdfunding validate_create.

Keep EventRecord.deadline as advisory metadata — still stored, still emitted on EventCreated, now owned by the backend. This means:

  • No storage-layout change, no migration, no ABI break — the field and CreateEventParams are untouched.
  • Every submission still records submitted_at, so you retain on-chain proof of when something was submitted; the backend compares it to whatever the (flexible, extendable) deadline is.

The now-dead DeadlineRequired / DeadlinePassed / DeadlineMustBeFuture variants are retired, which also frees 3 slots against the 50-case error-enum cap that #86/#88 kept bumping into.

Verification

  • cargo test --workspace: 220 events + 66 profile green (removed the 5 tests that asserted the deleted behavior)
  • make build (stellar-cli 27): events wasm 55,742 B (< 64 KB)
  • cargo fmt --check clean

Note

Physically removing the deadline field later (if ever wanted) is a separate storage-migration task and deliberately not coupled here.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features

    • Event creation no longer requires a deadline for crowdfunding campaigns or hackathons.
    • Submissions, applications, and withdrawals are no longer blocked after an event deadline.
    • Bounties remain available for applications while active, regardless of the original deadline.
  • Bug Fixes

    • Removed outdated deadline-related validation errors and restrictions across event workflows.

The submission deadline was enforced by the contract (reject apply/submit/
withdraw_submission after it, require+future-check at create), but it gates
nothing the contract is responsible for:
- no money path reads it (since #61 the payout/refund liveness is anchored
  to select-time via PRIZE_CLAIM_WINDOW_SECS, not the deadline);
- winners are the manager's discretion — select_winners never consults
  submissions, so a late submission row is inert;
- permissionless-submit storage abuse is bounded by the #86 count cap, not
  the deadline.

Meanwhile the deadline is immutable on-chain (no set/extend entrypoint), so
the contract could not support the extensions organizers do routinely. A
submission window — with its extensions, grace periods, and cutoffs — is a
backend/product concern; the chain keeps only custody, the count cap, and
discretionary winner selection.

Remove the enforcement:
- delete the deadline checks in submit / withdraw_submission / bounty apply
  and the create-time DeadlineMustBeFuture check;
- drop the required-deadline check from hackathon/crowdfunding validate_create.

Keep EventRecord.deadline as advisory metadata (still stored, emitted at
create, backend-owned) — no storage-layout change, no ABI break. The
now-dead DeadlineRequired/DeadlinePassed/DeadlineMustBeFuture variants are
retired, freeing 3 slots against the 50-case error-enum cap.

Removed the 5 tests that asserted the deleted behavior. 220 events + 66
profile green; make build OK (events 55,742 B); fmt clean.
@almanax-ai

almanax-ai Bot commented Jul 23, 2026

Copy link
Copy Markdown

Quota reached

Your plan allows 300 CI/CD file units per month. You've used 297 and this scan would add 8 more (total: 305).

@coderabbitai

coderabbitai Bot commented Jul 23, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: a925118b-7e2e-4534-a874-946b5c2678b3

📥 Commits

Reviewing files that changed from the base of the PR and between eed33cf and b747962.

📒 Files selected for processing (8)
  • contracts/events/src/bounty.rs
  • contracts/events/src/crowdfunding.rs
  • contracts/events/src/errors.rs
  • contracts/events/src/event_ops.rs
  • contracts/events/src/hackathon.rs
  • contracts/events/src/tests/bounty_pillar.rs
  • contracts/events/src/tests/crowdfunding.rs
  • contracts/events/src/tests/hackathon_pillar.rs
💤 Files with no reviewable changes (6)
  • contracts/events/src/hackathon.rs
  • contracts/events/src/tests/bounty_pillar.rs
  • contracts/events/src/tests/crowdfunding.rs
  • contracts/events/src/crowdfunding.rs
  • contracts/events/src/tests/hackathon_pillar.rs
  • contracts/events/src/event_ops.rs

📝 Walkthrough

Walkthrough

Deadline enforcement is removed from event creation, submissions, withdrawals, and bounty applications. Deadline-related errors and tests are deleted, while remaining pillar, status, authorization, and release validations stay intact.

Changes

Deadline policy removal

Layer / File(s) Summary
Creation validation policy
contracts/events/src/errors.rs, contracts/events/src/crowdfunding.rs, contracts/events/src/hackathon.rs, contracts/events/src/event_ops.rs, contracts/events/src/tests/crowdfunding.rs, contracts/events/src/tests/hackathon_pillar.rs
Event creation no longer requires a deadline or a future deadline, and the related error variants and tests are removed.
Submission lifecycle checks
contracts/events/src/event_ops.rs, contracts/events/src/tests/hackathon_pillar.rs
Submission and withdrawal operations no longer reject stored deadlines that have passed.
Bounty application checks
contracts/events/src/bounty.rs, contracts/events/src/tests/bounty_pillar.rs
Bounty application and withdrawal now validate only bounty pillar and active status; after-deadline rejection coverage is removed.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

Poem

I’m a bunny with deadlines untied,
No ticking clock can block the ride.
Bounties stay active, paths stay clear,
Submissions may hop beyond the year.
Hop hop hooray—the gates are wide!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: removing on-chain enforcement of submission deadlines in events.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/remove-deadline-enforcement

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@0xdevcollins
0xdevcollins merged commit 92eb157 into testnet Jul 23, 2026
4 checks passed
@0xdevcollins
0xdevcollins deleted the feat/remove-deadline-enforcement branch July 23, 2026 20:14
0xdevcollins added a commit that referenced this pull request Jul 23, 2026
)

#99 changed contract behavior (submission deadline no longer enforced on
chain) without a version bump. Bump events 1.4.0 -> 1.5.0 across
INITIAL_VERSION, contractmeta, and the Cargo package version so the next
testnet upgrade stamps a coherent version. Profile is unchanged by #99 and
stays 1.2.0.
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.

1 participant