Skip to content

feat: migrate turbo limits checks from SDK #495

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

Merged

Conversation

wa0x6e
Copy link
Contributor

@wa0x6e wa0x6e commented Jan 30, 2025

Toward https://github.com/snapshot-labs/workflow/issues/315
Depends on #494

After removing the turbo limits check in snapshot-labs/snapshot.js#1115 , this PR will add back those checks on sequencer side.

It will check for

  • proposal body length
  • number of proposal choices
  • number of space strategies

@wa0x6e wa0x6e changed the title Feat-check-turbo-limits feat: migrate turbo limits checks from SDK Jan 30, 2025
@wa0x6e wa0x6e force-pushed the feat-check-turbo-limits branch from 9f4e2f6 to f07b724 Compare January 30, 2025 20:23
@wa0x6e wa0x6e marked this pull request as ready for review January 30, 2025 20:24
@wa0x6e wa0x6e requested a review from ChaituVR February 3, 2025 15:30
Copy link
Member

@ChaituVR ChaituVR left a comment

Choose a reason for hiding this comment

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

utAck

will test in the other PR

@ChaituVR
Copy link
Member

ChaituVR commented Feb 5, 2025

@wa0x6e Can we merge this? this is blocking all other PRs

@ChaituVR ChaituVR merged commit 3c11c8c into feat-get-turbo-limit-from-database Feb 5, 2025
2 checks passed
@ChaituVR ChaituVR deleted the feat-check-turbo-limits branch February 5, 2025 04:25
wa0x6e added a commit that referenced this pull request Feb 6, 2025
* feat: get turbo limits from database

* refactor: fetch options from DB, without cache

* fix: fix missing await

* fix: fix wrong options name

* feat: migrate turbo limits checks from SDK (#495)

* feat: validate number of strategies depending on space type

* feat: check proposal limits

* refactor: avoid duplicate method calls

* chore(deps): bump @snapshot-labs/snapshot.js from 0.12.45 to 0.12.46 (#499)

Bumps [@snapshot-labs/snapshot.js](https://github.com/snapshot-labs/snapshot.js) from 0.12.45 to 0.12.46.
- [Release notes](https://github.com/snapshot-labs/snapshot.js/releases)
- [Commits](snapshot-labs/snapshot.js@v0.12.45...v0.12.46)

---
updated-dependencies:
- dependency-name: "@snapshot-labs/snapshot.js"
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Chaitanya <[email protected]>

* fix tests

* Update src/writer/proposal.ts

* fix lint and remove extra brace

* Update src/writer/proposal.ts

* perf: get limits with a single sql query

* move getSpaceType after validateSpace

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: Chaitanya <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
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