Skip to content

Commit

Permalink
[RELEASE] 0.12.0 (#573)
Browse files Browse the repository at this point in the history
## Description

## Definition of Done

1. [ ] If required, the desciption of your change is added to the [QA
changelog](https://www.notion.so/octantapp/Changelog-for-the-QA-d96fa3b411cf488bb1d8d9a598d88281)
2. [ ] Acceptance criteria are met.
3. [ ] PR is manually tested before the merge by developer(s).
    - [ ] Happy path is manually checked.
4. [ ] PR is manually tested by QA when their assistance is required
(1).
- [ ] Octant Areas & Test Cases are checked for impact and updated if
required (2).
5. [ ] Unit tests are added unless there is a reason to omit them.
6. [ ] Automated tests are added when required.
7. [ ] The code is merged.
8. [ ] Tech documentation is added / updated, reviewed and approved
(including mandatory approval by a code owner, should such exist for
changed files).
    - [ ] BE: Swagger documentation is updated.
9. [ ] When required by QA:
    - [ ] Deployed to the relevant environment.
    - [ ] Passed system tests.

---

(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](https://docs.google.com/spreadsheets/d/1cRe6dxuKJV3a4ZskAwWEPvrFkQm6rEfyUCYwLTYw_Cc).

---------

Signed-off-by: Marek Słomnicki <[email protected]>
Co-authored-by: Andrzej Ziółek <[email protected]>
Co-authored-by: Housekeeper Bot <[email protected]>
Co-authored-by: adam-gf <[email protected]>
Co-authored-by: Pawel Peregud <[email protected]>
Co-authored-by: Marek Słomnicki <[email protected]>
  • Loading branch information
6 people authored Dec 3, 2024
1 parent ebf27cf commit 75cd000
Show file tree
Hide file tree
Showing 30 changed files with 3,503 additions and 1,995 deletions.
5 changes: 5 additions & 0 deletions backend/.env.template
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,8 @@ MAINNET_PROPOSAL_CIDS=

SABLIER_MAINNET_SUBGRAPH_URL=
SABLIER_SEPOLIA_SUBGRAPH_URL=

CACHE_REDIS_HOST=
CACHE_REDIS_PORT=
CACHE_REDIS_PASSWORD=
CACHE_REDIS_DB=
3 changes: 3 additions & 0 deletions backend/app/infrastructure/external_api/gc_passport/score.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import requests

from app.extensions import cache
from app.constants import GC_PASSPORT_SCORER_API
from app.exceptions import ExternalApiException
from app.infrastructure.exception_handler import ExceptionHandler
Expand Down Expand Up @@ -29,6 +30,7 @@ def _get_issue_address_for_scoring_url() -> str:
return f"{GC_PASSPORT_SCORER_API}/registry/submit-passport"


@cache.memoize(timeout=1)
def issue_address_for_scoring(address: str) -> dict:
try:
response = requests.post(
Expand All @@ -48,6 +50,7 @@ def _get_fetch_score_url(scorer_id: str, address: str) -> str:
return f"{GC_PASSPORT_SCORER_API}/registry/score/{scorer_id}/{address}"


@cache.memoize(timeout=1)
def fetch_score(address: str) -> dict:
try:
response = requests.get(
Expand Down
28 changes: 15 additions & 13 deletions backend/app/infrastructure/graphql/epochs.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@

from app.extensions import gql_octant_factory

from app import exceptions
from app import exceptions, cache


@cache.memoize(timeout=15)
def get_epoch_by_number(epoch_number):
query = gql(
"""
Expand Down Expand Up @@ -39,21 +40,22 @@ def get_epoch_by_number(epoch_number):
raise exceptions.EpochNotIndexed(epoch_number)


@cache.memoize(timeout=15)
def get_epochs():
query = gql(
"""
query {
epoches(first: 1000) {
epoch
fromTs
toTs
}
_meta {
block {
number
}
}
}
query {
epoches(first: 1000) {
epoch
fromTs
toTs
}
_meta {
block {
number
}
}
}
"""
)

Expand Down
4 changes: 3 additions & 1 deletion backend/app/infrastructure/graphql/withdrawals.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
from flask import current_app as app
from gql import gql

from app.extensions import gql_octant_factory
from app.extensions import gql_octant_factory, cache


@cache.memoize(timeout=60)
def get_user_withdrawals_history(user_address: str, from_timestamp: int, limit: int):
query = gql(
"""
Expand Down Expand Up @@ -52,6 +53,7 @@ def get_user_withdrawals_history(user_address: str, from_timestamp: int, limit:
return result


@cache.memoize(timeout=60)
def get_withdrawals_by_address_and_timestamp_range(
user_address: str, from_timestamp: int, to_timestamp: int
):
Expand Down
10 changes: 8 additions & 2 deletions backend/app/legacy/crypto/eth_sign/patron_mode.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
from app.legacy.crypto.eth_sign.signature import verify_signed_message
from app.modules.common.crypto.signature import (
encode_for_signing,
EncodingStandardFor,
verify_signed_message,
)


def build_patron_mode_msg(user_address: str, toggle: bool) -> str:
Expand All @@ -9,4 +13,6 @@ def build_patron_mode_msg(user_address: str, toggle: bool) -> str:
def verify(user_address: str, toggle: bool, signature: str) -> bool:
msg_text = build_patron_mode_msg(user_address, toggle)

return verify_signed_message(user_address, msg_text, signature)
encoded_msg = encode_for_signing(EncodingStandardFor.TEXT, msg_text)

return verify_signed_message(user_address, encoded_msg, signature)
36 changes: 0 additions & 36 deletions backend/app/legacy/crypto/eth_sign/signature.py

This file was deleted.

3 changes: 2 additions & 1 deletion backend/app/modules/user/antisybil/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@ def _has_guest_stamp_applied_by_gp(score: GPStamps) -> bool:


def _apply_gtc_staking_stamp_nullification(score: int, stamps: GPStamps) -> int:
"Take score and stamps as returned by Passport and remove score associated with GTC staking"
"""Take score and stamps as returned by Passport and remove score associated with GTC staking"""

delta = 0
all_stamps = json.loads(stamps.stamps)
providers = [_get_provider(stamp) for stamp in all_stamps]
Expand Down
Loading

0 comments on commit 75cd000

Please sign in to comment.