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: allow list solver flag #48

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,11 @@
"type": "relation",
"relation": "oneToOne",
"target": "api::environment.environment"
},
"allowListed": {
Copy link
Contributor

Choose a reason for hiding this comment

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

fine with me, but for me is more clear to just say "isOperating".
Also, renaming active to isWhiteListed could be a good idea. We can just add the flag, make sure they match, make the changes in CoW Swap, and then delete the old flag. I don't see anyone else uses this (maybe my spreadsheet and I can adapt it)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The point about adding a new flag is that, at least from what I could gather from the solver's team view, it has a different connotation that what we need for the progress bar.

They set it to active when the solver has been allow-listed, even if the solver is not running for that environment.

Thus, the new flag is meant to signal that, while active remains what we expect: the solver is enabled and solving for the given network/environment.

Copy link
Contributor

Choose a reason for hiding this comment

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

Well, I understood the other way around. Active was that our protocol whitelisted them, although I see why it makes sense too what you say.

This is why I was suggesting to not leave "active" to avoid confusion.

isWhiteListed --> whitelitest in the protocol.
isOperating ---> is running an instance and posting solutions

Copy link
Contributor

Choose a reason for hiding this comment

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

maybe there's better names, but just think that "active" might be confusing

Copy link
Contributor

@anxolin anxolin Jan 9, 2025

Choose a reason for hiding this comment

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

Alternativelly, we don't use flags, and we just model the status: WHITE_LISTED_INACTIVE, WHITE_ACTIVE, NOT_WHITE_LISTED

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is why I was suggesting to not leave "active" to avoid confusion.

Ah got it.

Alternativelly, we don't use flags, and we just model the status

I don't get this one. Would that be a new entity?

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm just suggesting an enumeration if there's only 3 possible values. A bit verbose but less error prone WHITE_LISTED_INACTIVE, WHITE_ACTIVE, NOT_WHITE_LISTED

image

Copy link
Contributor

Choose a reason for hiding this comment

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

but probably not a good idea, and we want to separate the 2 concerns. I imagine that if this is automatically managed, the whitelisted flag is set manually, but the active is set automatically (for example, solver hasn't posted a solution in 24h)

"type": "boolean",
"default": false,
"required": true
}
}
}
5 changes: 0 additions & 5 deletions src/api/solver/content-types/solver/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,6 @@
"type": "string",
"required": true
},
"active": {
"type": "boolean",
"default": true,
"required": true
},
"image": {
"type": "media",
"multiple": false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"name": "Apache 2.0",
"url": "https://www.apache.org/licenses/LICENSE-2.0.html"
},
"x-generation-date": "2024-12-16T11:10:37.171Z"
"x-generation-date": "2025-01-06T16:25:21.759Z"
},
"x-strapi-config": {
"path": "/documentation",
Expand Down Expand Up @@ -242,9 +242,6 @@
"displayName": {
"type": "string"
},
"active": {
"type": "boolean"
},
"image": {
"type": "object",
"properties": {
Expand Down Expand Up @@ -1208,6 +1205,9 @@
}
}
},
"allowListed": {
"type": "boolean"
},
"createdAt": {
"type": "string",
"format": "date-time"
Expand Down Expand Up @@ -6651,9 +6651,6 @@
"displayName": {
"type": "string"
},
"active": {
"type": "boolean"
},
"image": {
"type": "object",
"properties": {
Expand Down Expand Up @@ -7225,6 +7222,9 @@
}
}
},
"allowListed": {
"type": "boolean"
},
"createdAt": {
"type": "string",
"format": "date-time"
Expand Down Expand Up @@ -14786,9 +14786,6 @@
"displayName": {
"type": "string"
},
"active": {
"type": "boolean"
},
"image": {
"type": "object",
"properties": {
Expand Down Expand Up @@ -15821,6 +15818,9 @@
}
}
},
"allowListed": {
"type": "boolean"
},
"createdAt": {
"type": "string",
"format": "date-time"
Expand Down Expand Up @@ -20669,17 +20669,13 @@
"data": {
"required": [
"displayName",
"active",
"solverId"
],
"type": "object",
"properties": {
"displayName": {
"type": "string"
},
"active": {
"type": "boolean"
},
"image": {
"oneOf": [
{
Expand Down Expand Up @@ -20785,16 +20781,12 @@
"type": "object",
"required": [
"displayName",
"active",
"solverId"
],
"properties": {
"displayName": {
"type": "string"
},
"active": {
"type": "boolean"
},
"image": {
"type": "object",
"properties": {
Expand Down Expand Up @@ -21457,9 +21449,6 @@
"displayName": {
"type": "string"
},
"active": {
"type": "boolean"
},
"image": {
"type": "object",
"properties": {
Expand Down Expand Up @@ -22010,6 +21999,9 @@
}
}
},
"allowListed": {
"type": "boolean"
},
"createdAt": {
"type": "string",
"format": "date-time"
Expand Down Expand Up @@ -22324,9 +22316,6 @@
"displayName": {
"type": "string"
},
"active": {
"type": "boolean"
},
"image": {
"type": "object",
"properties": {
Expand Down Expand Up @@ -23149,6 +23138,9 @@
}
}
},
"allowListed": {
"type": "boolean"
},
"createdAt": {
"type": "string",
"format": "date-time"
Expand Down Expand Up @@ -23458,7 +23450,8 @@
"properties": {
"data": {
"required": [
"active"
"active",
"allowListed"
],
"type": "object",
"properties": {
Expand Down Expand Up @@ -23503,6 +23496,9 @@
}
],
"example": "string or id"
},
"allowListed": {
"type": "boolean"
}
}
}
Expand Down Expand Up @@ -23557,7 +23553,8 @@
"SolverNetwork": {
"type": "object",
"required": [
"active"
"active",
"allowListed"
],
"properties": {
"solver": {
Expand All @@ -23575,9 +23572,6 @@
"displayName": {
"type": "string"
},
"active": {
"type": "boolean"
},
"image": {
"type": "object",
"properties": {
Expand Down Expand Up @@ -24400,6 +24394,9 @@
}
}
},
"allowListed": {
"type": "boolean"
},
"createdAt": {
"type": "string",
"format": "date-time"
Expand Down Expand Up @@ -24713,6 +24710,9 @@
}
}
},
"allowListed": {
"type": "boolean"
},
"createdAt": {
"type": "string",
"format": "date-time"
Expand Down Expand Up @@ -26837,9 +26837,6 @@
"displayName": {
"type": "string"
},
"active": {
"type": "boolean"
},
"image": {
"type": "object",
"properties": {
Expand Down Expand Up @@ -27803,6 +27800,9 @@
}
}
},
"allowListed": {
"type": "boolean"
},
"createdAt": {
"type": "string",
"format": "date-time"
Expand Down
Loading