Skip to content
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

feat(starknet): add support for maintenance mode #424

Merged
merged 2 commits into from
Aug 28, 2024

Conversation

ptisserand
Copy link
Contributor

@ptisserand ptisserand commented Aug 22, 2024

Description

Add support for maintenance mode, when executor is disabled, the following functions will revert:

  • create_order
  • cancel_order
  • execute_order
  • fulfill_order

Here is the interface for maintenance mode:

#[starknet::interface]
trait IMaintenance<T> {
    fn is_enabled(self: @T) -> bool;
    fn enable(ref self: T, enable: bool);
}

IMaintenance::enable can only be invoked by admin

What type of PR is this? (check all applicable)

  • 🍕 Feature (feat:)
  • 🐛 Bug Fix (fix:)
  • 📝 Documentation Update (docs:)
  • 🎨 Style (style:)
  • 🧑‍💻 Code Refactor (refactor:)
  • 🔥 Performance Improvements (perf:)
  • ✅ Test (test:)
  • 🤖 Build (build:)
  • 🔁 CI (ci:)
  • 📦 Chore (chore:)
  • ⏩ Revert (revert:)
  • 🚀 Breaking Changes (BREAKING CHANGE:)

Related Tickets & Documents

Added tests?

  • 👍 yes
  • 🙅 no, because they aren't needed
  • 🙋 no, because I need help

Added to documentation?

  • 📜 README.md
  • 📓 Documentation
  • 🙅 no documentation needed

[optional] Are there any post-deployment tasks we need to perform?

[optional] What gif best describes this PR or how it makes you feel?

PR Title and Description Guidelines:

  • Ensure your PR title follows semantic versioning standards. This helps automate releases and changelogs.
  • Use types like feat:, fix:, chore:, BREAKING CHANGE: etc. in your PR title.
  • Your PR title will be used as a commit message when merging. Make sure it adheres to Conventional Commits standards.

Closing Issues

Copy link

vercel bot commented Aug 22, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
ark-project-sdk-demo ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 22, 2024 2:54pm

Copy link

changeset-bot bot commented Aug 22, 2024

⚠️ No Changeset found

Latest commit: 0567cfb

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link

linear bot commented Aug 22, 2024

@ptisserand ptisserand requested a review from kwiss August 22, 2024 14:54
Comment on lines 43 to 62
trait IMaintenance<T> {
fn is_enabled(self: @T) -> bool;
fn enable(ref self: T, enable: bool);
}
Copy link
Contributor

Choose a reason for hiding this comment

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

could we use a more descriptive function name here ? like set_maintenance_mode

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated:

#[starknet::interface]
trait IMaintenance<T> {
    fn is_in_maintenance(self: @T) -> bool;
    fn set_maintenance_mode(ref self: T, on: bool);
}

@ptisserand ptisserand force-pushed the feature/dev-720-executor-maintenance-mode branch from efca109 to 0567cfb Compare August 28, 2024 13:52
@ptisserand ptisserand merged commit ff919d9 into main Aug 28, 2024
2 checks passed
@ptisserand ptisserand deleted the feature/dev-720-executor-maintenance-mode branch August 28, 2024 14:30
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