-
Notifications
You must be signed in to change notification settings - Fork 7
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
OCT-1895: basic holonym integration #393
base: develop
Are you sure you want to change the base?
Conversation
b92e3fd
to
3815cda
Compare
2a2d4c3
to
7001869
Compare
id = Column(db.Integer, primary_key=True) | ||
user_id = Column(db.Integer, db.ForeignKey("users.id"), nullable=False) | ||
has_sbt = Column(db.Boolean, nullable=False, default=False) | ||
sbt_details = Column(db.String, nullable=False, default="[]") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we set a default param as [] or just "" since it's a string and it'd make the future validations a bit easier?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This field is processed as json. Both [] and "" are not a valid JSON string.
@@ -12,21 +12,30 @@ | |||
|
|||
|
|||
@runtime_checkable | |||
class Antisybil(Protocol): | |||
class Passport(Protocol): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
class Passport(Protocol): | |
class GPAntisybil(Protocol): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately one of proposed names clashes with some other name. I'll leave both as they are.
def get_antisybil_status( | ||
self, _: Context, user_address: str | ||
) -> Optional[Tuple[float, datetime]]: | ||
... | ||
|
||
|
||
@runtime_checkable | ||
class Holonym(Protocol): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
class Holonym(Protocol): | |
class HolonymAntisybil(Protocol): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately one of proposed names clashes with some other name. I'll leave both as they are.
backend/migrations/versions/003a0cad5494_add_cached_status_for_holonym_sbt.py
Outdated
Show resolved
Hide resolved
backend/migrations/versions/8b425b454a86_fix_created_at_field.py
Outdated
Show resolved
Hide resolved
@@ -25,7 +25,7 @@ | |||
"apitest:logs": "docker compose -p apitest -f ./localenv/docker-compose.yaml -f ./localenv/apitest.yaml logs", | |||
"apitest:run": "docker compose -p apitest -f ./localenv/docker-compose.yaml -f ./localenv/apitest.yaml run backend-apitest", | |||
"apitest:clean": "docker rm -v -f $(docker ps -qa --filter 'name=apitest') || true", | |||
"preapitest:up": "yarn apitest:clean", | |||
"preapitest:up": "yarn apitest:clean; rm -f backend/dev.db", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think we don't need rm -f backend/dev.db in the general API testing config?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since apitest is just spiced up unit test, it runs in test env and thus, it uses sqlite, that particular file. This went undetected for a long time, but if dev.db already has some data, test may crash. This could be a case on a dev machine.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, actual solution is making sure that dev.db is not being copied into apitest-backend docker container. Will fix this.
E_PASSPORT_ON_DEVICE_WITH_ZK = "epassport" | ||
|
||
|
||
def check( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i'm not sure if it shouldn't be directly in the service since it's something more about the functional logic, not the API itself but just raising up the case, it's up to you
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All it does is iterate through credential type, enhancing API a bit. I wouldn't call that logic. Just presenting data in a bit more useful manner.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me for the first pass, although there is some uncertainty now about including holonym in this release
@@ -52,6 +52,14 @@ class GPStamps(BaseModel): | |||
stamps = Column(db.String, nullable=False) | |||
|
|||
|
|||
class HolonymSBT(BaseModel): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i also started thinking if we shouldn't match HolonymSBT with a specific epoch that it corresponds to? it'll help to distinguish between these tokens that are valid and expired ones (since we want to verify it for every epoch specifically, right?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Holonym's API doesn't return information about expiration. We should refresh SBT status when user allocates.
7872931
to
c64bb47
Compare
Otherwise localenv doesn't start
Co-authored-by: Kacper Garbaciński <[email protected]>
* use DTO instead of tuples * return partial results when fetching antisybil status - they are enough for FE * lineup declared and actual types
96829e4
to
77a91fe
Compare
* use `exec` when starting multideployer * run services that struggle with reaping with dedicated PID 1 process (https://blog.phusion.nl/2015/01/20/docker-and-the-pid-1-zombie-reaping-problem/) This two measures drops shutdown time from 10s to 4s.
77a91fe
to
a33a0fc
Compare
Description
Definition of Done
(1) Developer(s) in coordination with QA decide whether it's required. For small tickets introducing small changes QA assistance is most probably not required.
(2) Octant Areas & Test Cases.