Skip to content

Commit fecee9b

Browse files
authored
Merge pull request #3017 from humanprotocol/develop
Release 2025-02-05
2 parents 06f37d2 + 087ba3c commit fecee9b

File tree

605 files changed

+5912
-5127
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

605 files changed

+5912
-5127
lines changed

.dockerignore

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Common file for apps that rely on root context
2+
.git
3+
.github
4+
.husky
5+
audits
6+
docs
7+
scripts
8+
**/node_modules
9+
**/build
10+
**/dist
11+
12+
# Core package artifacts
13+
# Hardhat files
14+
**/abis
15+
**/artifacts
16+
**/cache
17+
**/.deps
18+
# TypeScript bindings output directory
19+
**/typechain-types
20+
21+
# Docker-related
22+
.dockerignore
23+
**/Dockerfile*
24+
**/docker-compose*

.github/workflows/cd-cvat-exchange-oracle.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ on:
1414
permissions:
1515
id-token: write
1616
contents: read
17+
concurrency:
18+
group: docker-compose-oracles-${{ github.ref }}
19+
cancel-in-progress: false # Ensure the workflow waits instead of canceling others
1720

1821
jobs:
1922
pull-request-check:

.github/workflows/cd-cvat-recording-oracle.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ permissions:
1515
id-token: write
1616
contents: read
1717

18+
concurrency:
19+
group: docker-compose-oracles-${{ github.ref }}
20+
cancel-in-progress: false # Ensure the workflow waits instead of canceling others
21+
1822
jobs:
1923
pull-request-check:
2024
runs-on: ubuntu-latest

.github/workflows/cd-subgraph.yaml

Lines changed: 31 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ on:
66
label:
77
description: 'New version label'
88
required: true
9+
networks:
10+
description: 'Comma-separated list of networks to deploy'
11+
required: true
912

1013
jobs:
1114
subgraph:
@@ -15,41 +18,59 @@ jobs:
1518
matrix:
1619
network:
1720
- name: amoy
18-
- name: avalanche
1921
- name: bsc-testnet
2022
- name: bsc
21-
- name: celo-alfajores
22-
- name: celo
2323
- name: ethereum
24-
- name: fuji
25-
- name: moonbase-alpha
26-
- name: moonbeam
2724
- name: polygon
2825
- name: sepolia
29-
- name: xlayer-testnet
30-
- name: xlayer
3126
fail-fast: true
3227
max-parallel: 3
3328
steps:
3429
- uses: actions/checkout@v4
35-
- run: npm install --global yarn && yarn --ignore-scripts
30+
- name: Set up Node.js
31+
uses: actions/setup-node@v4
32+
with:
33+
node-version: '18.20.1'
34+
- name: Filter Networks
35+
id: filter_networks
36+
run: |
37+
INPUT_NETWORKS="${{ github.event.inputs.networks }}"
38+
IFS=',' read -ra NETWORK_LIST <<< "$INPUT_NETWORKS"
39+
echo "Input networks: $INPUT_NETWORKS"
40+
echo "Current matrix network: ${{ matrix.network.name }}"
41+
MATCH=false
42+
for network in "${NETWORK_LIST[@]}"; do
43+
if [[ "${network}" == "${{ matrix.network.name }}" ]]; then
44+
MATCH=true
45+
break
46+
fi
47+
done
48+
echo "Match found: $MATCH"
49+
echo "::set-output name=continue::$MATCH"
50+
- run: npm install --global yarn && yarn
3651
name: Install dependencies
52+
if: steps.filter_networks.outputs.continue == 'true'
3753
- run: yarn build
3854
name: Build core package
3955
working-directory: ./packages/core
40-
- run: yarn global add @graphprotocol/graph-cli
56+
if: steps.filter_networks.outputs.continue == 'true'
57+
- run: yarn global add @graphprotocol/[email protected]
4158
name: Install Graph CLI
59+
if: steps.filter_networks.outputs.continue == 'true'
4260
- run: graph auth --studio ${API_KEY}
4361
name: Authenticate Graph CLI
4462
env:
4563
API_KEY: ${{ secrets.HP_GRAPH_API_KEY }}
64+
if: steps.filter_networks.outputs.continue == 'true'
4665
- run: yarn generate && yarn build
4766
name: Generate and build Subgraph
4867
working-directory: ./packages/sdk/typescript/subgraph
4968
env:
5069
NETWORK: ${{ matrix.network.name }}
70+
if: steps.filter_networks.outputs.continue == 'true'
5171
- run: graph deploy --studio ${NETWORK} -l ${{ github.event.inputs.label }}
5272
name: Deploy Subgraph
5373
working-directory: ./packages/sdk/typescript/subgraph
5474
env:
5575
NETWORK: ${{ matrix.network.name }}
76+
if: steps.filter_networks.outputs.continue == 'true'

.github/workflows/ci-test-subgraph.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ on:
1313
jobs:
1414
subgraph-test:
1515
name: Subgraph Test
16-
runs-on: ubuntu-latest
16+
# TODO: Use ubuntu-latest when graph binary is not failing on ubuntu 24.04
17+
runs-on: ubuntu-22.04
1718
steps:
1819
- uses: actions/checkout@v4
1920
- run: npm install --global yarn && yarn

.gitignore

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,8 @@ node_modules
33

44
# dotenv environment variable files
55
.env
6-
.env.development.local
7-
.env.test.local
8-
.env.production.local
96
.env.local
7+
.env.*.local
108

119
# Log files
1210
npm-debug.log*

docs/sdk/python/human_protocol_sdk.constants.md

Lines changed: 17 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -6,54 +6,36 @@ Bases: `Enum`
66

77
Enum for chain IDs.
88

9-
#### AVALANCHE *= 43114*
10-
11-
#### AVALANCHE_TESTNET *= 43113*
12-
139
#### BSC_MAINNET *= 56*
1410

1511
#### BSC_TESTNET *= 97*
1612

17-
#### CELO *= 42220*
18-
19-
#### CELO_ALFAJORES *= 44787*
20-
21-
#### GOERLI *= 5*
22-
2313
#### LOCALHOST *= 1338*
2414

2515
#### MAINNET *= 1*
2616

27-
#### MOONBASE_ALPHA *= 1287*
28-
29-
#### MOONBEAM *= 1284*
30-
3117
#### POLYGON *= 137*
3218

3319
#### POLYGON_AMOY *= 80002*
3420

35-
#### POLYGON_MUMBAI *= 80001*
36-
37-
#### RINKEBY *= 4*
38-
3921
#### SEPOLIA *= 11155111*
4022

41-
#### XLAYER *= 196*
42-
43-
#### XLAYER_TESTNET *= 195*
44-
4523
### *class* human_protocol_sdk.constants.KVStoreKeys(value)
4624

4725
Bases: `Enum`
4826

4927
Enum for KVStore keys
5028

29+
#### category *= 'category'*
30+
5131
#### fee *= 'fee'*
5232

5333
#### job_types *= 'job_types'*
54-
34+
#### name *= 'name'*
5535
#### public_key *= 'public_key'*
5636

37+
#### public_key_hash *= 'public_key_hash'*
38+
5739
#### registration_instructions *= 'registration_instructions'*
5840

5941
#### registration_needed *= 'registration_needed'*
@@ -64,6 +46,18 @@ Enum for KVStore keys
6446

6547
#### webhook_url *= 'webhook_url'*
6648

49+
#### website *= 'website'*
50+
51+
### *class* human_protocol_sdk.constants.LeaderCategory(value)
52+
53+
Bases: `Enum`
54+
55+
Enum for leader categories
56+
57+
#### MACHINE_LEARNING *= 'machine_learning'*
58+
59+
#### MARKET_MAKING *= 'market_making'*
60+
6761
### *class* human_protocol_sdk.constants.OrderDirection(value)
6862

6963
Bases: `Enum`
@@ -88,8 +82,6 @@ Enum for roles.
8882

8983
#### reputation_oracle *= 'Reputation Oracle'*
9084

91-
#### validator *= 'Validator'*
92-
9385
### *class* human_protocol_sdk.constants.Status(value)
9486

9587
Bases: `Enum`

docs/sdk/python/human_protocol_sdk.md

Lines changed: 6 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -59,16 +59,6 @@
5959
* [Module](human_protocol_sdk.kvstore.kvstore_utils.md#module)
6060
* [`KVStoreData`](human_protocol_sdk.kvstore.kvstore_utils.md#human_protocol_sdk.kvstore.kvstore_utils.KVStoreData)
6161
* [`KVStoreUtils`](human_protocol_sdk.kvstore.kvstore_utils.md#human_protocol_sdk.kvstore.kvstore_utils.KVStoreUtils)
62-
* [human_protocol_sdk.kvstore.kvstore_utils module](human_protocol_sdk.kvstore.kvstore_utils.md)
63-
* [Code Example](human_protocol_sdk.kvstore.kvstore_utils.md#code-example)
64-
* [Module](human_protocol_sdk.kvstore.kvstore_utils.md#module)
65-
* [`KVStoreData`](human_protocol_sdk.kvstore.kvstore_utils.md#human_protocol_sdk.kvstore.kvstore_utils.KVStoreData)
66-
* [`KVStoreData.__init__()`](human_protocol_sdk.kvstore.kvstore_utils.md#human_protocol_sdk.kvstore.kvstore_utils.KVStoreData.__init__)
67-
* [`KVStoreUtils`](human_protocol_sdk.kvstore.kvstore_utils.md#human_protocol_sdk.kvstore.kvstore_utils.KVStoreUtils)
68-
* [`KVStoreUtils.get()`](human_protocol_sdk.kvstore.kvstore_utils.md#human_protocol_sdk.kvstore.kvstore_utils.KVStoreUtils.get)
69-
* [`KVStoreUtils.get_file_url_and_verify_hash()`](human_protocol_sdk.kvstore.kvstore_utils.md#human_protocol_sdk.kvstore.kvstore_utils.KVStoreUtils.get_file_url_and_verify_hash)
70-
* [`KVStoreUtils.get_kvstore_data()`](human_protocol_sdk.kvstore.kvstore_utils.md#human_protocol_sdk.kvstore.kvstore_utils.KVStoreUtils.get_kvstore_data)
71-
* [`KVStoreUtils.get_public_key()`](human_protocol_sdk.kvstore.kvstore_utils.md#human_protocol_sdk.kvstore.kvstore_utils.KVStoreUtils.get_public_key)
7262
* [human_protocol_sdk.operator package](human_protocol_sdk.operator.md)
7363
* [Submodules](human_protocol_sdk.operator.md#submodules)
7464
* [human_protocol_sdk.operator.operator_utils module](human_protocol_sdk.operator.operator_utils.md)
@@ -129,33 +119,28 @@
129119

130120
* [human_protocol_sdk.constants module](human_protocol_sdk.constants.md)
131121
* [`ChainId`](human_protocol_sdk.constants.md#human_protocol_sdk.constants.ChainId)
132-
* [`ChainId.AVALANCHE`](human_protocol_sdk.constants.md#human_protocol_sdk.constants.ChainId.AVALANCHE)
133-
* [`ChainId.AVALANCHE_TESTNET`](human_protocol_sdk.constants.md#human_protocol_sdk.constants.ChainId.AVALANCHE_TESTNET)
134122
* [`ChainId.BSC_MAINNET`](human_protocol_sdk.constants.md#human_protocol_sdk.constants.ChainId.BSC_MAINNET)
135123
* [`ChainId.BSC_TESTNET`](human_protocol_sdk.constants.md#human_protocol_sdk.constants.ChainId.BSC_TESTNET)
136-
* [`ChainId.CELO`](human_protocol_sdk.constants.md#human_protocol_sdk.constants.ChainId.CELO)
137-
* [`ChainId.CELO_ALFAJORES`](human_protocol_sdk.constants.md#human_protocol_sdk.constants.ChainId.CELO_ALFAJORES)
138-
* [`ChainId.GOERLI`](human_protocol_sdk.constants.md#human_protocol_sdk.constants.ChainId.GOERLI)
139124
* [`ChainId.LOCALHOST`](human_protocol_sdk.constants.md#human_protocol_sdk.constants.ChainId.LOCALHOST)
140125
* [`ChainId.MAINNET`](human_protocol_sdk.constants.md#human_protocol_sdk.constants.ChainId.MAINNET)
141-
* [`ChainId.MOONBASE_ALPHA`](human_protocol_sdk.constants.md#human_protocol_sdk.constants.ChainId.MOONBASE_ALPHA)
142-
* [`ChainId.MOONBEAM`](human_protocol_sdk.constants.md#human_protocol_sdk.constants.ChainId.MOONBEAM)
143126
* [`ChainId.POLYGON`](human_protocol_sdk.constants.md#human_protocol_sdk.constants.ChainId.POLYGON)
144127
* [`ChainId.POLYGON_AMOY`](human_protocol_sdk.constants.md#human_protocol_sdk.constants.ChainId.POLYGON_AMOY)
145-
* [`ChainId.POLYGON_MUMBAI`](human_protocol_sdk.constants.md#human_protocol_sdk.constants.ChainId.POLYGON_MUMBAI)
146-
* [`ChainId.RINKEBY`](human_protocol_sdk.constants.md#human_protocol_sdk.constants.ChainId.RINKEBY)
147128
* [`ChainId.SEPOLIA`](human_protocol_sdk.constants.md#human_protocol_sdk.constants.ChainId.SEPOLIA)
148-
* [`ChainId.XLAYER`](human_protocol_sdk.constants.md#human_protocol_sdk.constants.ChainId.XLAYER)
149-
* [`ChainId.XLAYER_TESTNET`](human_protocol_sdk.constants.md#human_protocol_sdk.constants.ChainId.XLAYER_TESTNET)
150129
* [`KVStoreKeys`](human_protocol_sdk.constants.md#human_protocol_sdk.constants.KVStoreKeys)
130+
* [`KVStoreKeys.category`](human_protocol_sdk.constants.md#human_protocol_sdk.constants.KVStoreKeys.category)
151131
* [`KVStoreKeys.fee`](human_protocol_sdk.constants.md#human_protocol_sdk.constants.KVStoreKeys.fee)
152132
* [`KVStoreKeys.job_types`](human_protocol_sdk.constants.md#human_protocol_sdk.constants.KVStoreKeys.job_types)
153133
* [`KVStoreKeys.public_key`](human_protocol_sdk.constants.md#human_protocol_sdk.constants.KVStoreKeys.public_key)
134+
* [`KVStoreKeys.public_key_hash`](human_protocol_sdk.constants.md#human_protocol_sdk.constants.KVStoreKeys.public_key_hash)
154135
* [`KVStoreKeys.registration_instructions`](human_protocol_sdk.constants.md#human_protocol_sdk.constants.KVStoreKeys.registration_instructions)
155136
* [`KVStoreKeys.registration_needed`](human_protocol_sdk.constants.md#human_protocol_sdk.constants.KVStoreKeys.registration_needed)
156137
* [`KVStoreKeys.role`](human_protocol_sdk.constants.md#human_protocol_sdk.constants.KVStoreKeys.role)
157138
* [`KVStoreKeys.url`](human_protocol_sdk.constants.md#human_protocol_sdk.constants.KVStoreKeys.url)
158139
* [`KVStoreKeys.webhook_url`](human_protocol_sdk.constants.md#human_protocol_sdk.constants.KVStoreKeys.webhook_url)
140+
* [`KVStoreKeys.website`](human_protocol_sdk.constants.md#human_protocol_sdk.constants.KVStoreKeys.website)
141+
* [`LeaderCategory`](human_protocol_sdk.constants.md#human_protocol_sdk.constants.LeaderCategory)
142+
* [`LeaderCategory.MACHINE_LEARNING`](human_protocol_sdk.constants.md#human_protocol_sdk.constants.LeaderCategory.MACHINE_LEARNING)
143+
* [`LeaderCategory.MARKET_MAKING`](human_protocol_sdk.constants.md#human_protocol_sdk.constants.LeaderCategory.MARKET_MAKING)
159144
* [`OrderDirection`](human_protocol_sdk.constants.md#human_protocol_sdk.constants.OrderDirection)
160145
* [`OrderDirection.ASC`](human_protocol_sdk.constants.md#human_protocol_sdk.constants.OrderDirection.ASC)
161146
* [`OrderDirection.DESC`](human_protocol_sdk.constants.md#human_protocol_sdk.constants.OrderDirection.DESC)
@@ -164,7 +149,6 @@
164149
* [`Role.job_launcher`](human_protocol_sdk.constants.md#human_protocol_sdk.constants.Role.job_launcher)
165150
* [`Role.recording_oracle`](human_protocol_sdk.constants.md#human_protocol_sdk.constants.Role.recording_oracle)
166151
* [`Role.reputation_oracle`](human_protocol_sdk.constants.md#human_protocol_sdk.constants.Role.reputation_oracle)
167-
* [`Role.validator`](human_protocol_sdk.constants.md#human_protocol_sdk.constants.Role.validator)
168152
* [`Status`](human_protocol_sdk.constants.md#human_protocol_sdk.constants.Status)
169153
* [`Status.Cancelled`](human_protocol_sdk.constants.md#human_protocol_sdk.constants.Status.Cancelled)
170154
* [`Status.Complete`](human_protocol_sdk.constants.md#human_protocol_sdk.constants.Status.Complete)

docs/sdk/python/human_protocol_sdk.operator.operator_utils.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@ print(
1717

1818
## Module
1919

20-
### *class* human_protocol_sdk.operator.operator_utils.LeaderData(chain_id, id, address, amount_staked, amount_locked, locked_until_timestamp, amount_withdrawn, amount_slashed, reward, amount_jobs_processed, role=None, fee=None, public_key=None, webhook_url=None, website=None, url=None, job_types=None, registration_needed=None, registration_instructions=None, reputation_networks=None)
20+
### *class* human_protocol_sdk.operator.operator_utils.LeaderData(chain_id, id, address, amount_staked, amount_locked, locked_until_timestamp, amount_withdrawn, amount_slashed, reward, amount_jobs_processed, role=None, fee=None, public_key=None, webhook_url=None, website=None, url=None, job_types=None, registration_needed=None, registration_instructions=None, reputation_networks=None, name=None, category=None)
2121

2222
Bases: `object`
2323

24-
#### \_\_init_\_(chain_id, id, address, amount_staked, amount_locked, locked_until_timestamp, amount_withdrawn, amount_slashed, reward, amount_jobs_processed, role=None, fee=None, public_key=None, webhook_url=None, website=None, url=None, job_types=None, registration_needed=None, registration_instructions=None, reputation_networks=None)
24+
#### \_\_init_\_(chain_id, id, address, amount_staked, amount_locked, locked_until_timestamp, amount_withdrawn, amount_slashed, reward, amount_jobs_processed, role=None, fee=None, public_key=None, webhook_url=None, website=None, url=None, job_types=None, registration_needed=None, registration_instructions=None, reputation_networks=None, name=None, category=None)
2525

2626
Initializes a LeaderData instance.
2727

@@ -46,6 +46,8 @@ Initializes a LeaderData instance.
4646
* **registration_needed** (`Optional`[`bool`]) – Whether registration is needed
4747
* **registration_instructions** (`Optional`[`str`]) – Registration instructions
4848
* **reputation_networks** (`Optional`[`List`[`str`]]) – List of reputation networks
49+
* **name** (`Optional`[`str`]) – Name
50+
* **category** (`Optional`[`str`]) – Category
4951

5052
### *class* human_protocol_sdk.operator.operator_utils.LeaderFilter(chain_id, roles=[], min_amount_staked=None, order_by=None, order_direction=OrderDirection.DESC, first=10, skip=0)
5153

docs/sdk/python/index.md

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,6 @@ pip install human-protocol-sdk[agreement]
3232
* [Submodules](human_protocol_sdk.escrow.md#submodules)
3333
* [human_protocol_sdk.kvstore package](human_protocol_sdk.kvstore.md)
3434
* [Submodules](human_protocol_sdk.kvstore.md#submodules)
35-
* [human_protocol_sdk.kvstore.kvstore_utils module](human_protocol_sdk.kvstore.kvstore_utils.md)
36-
* [Code Example](human_protocol_sdk.kvstore.kvstore_utils.md#code-example)
37-
* [Module](human_protocol_sdk.kvstore.kvstore_utils.md#module)
38-
* [`KVStoreData`](human_protocol_sdk.kvstore.kvstore_utils.md#human_protocol_sdk.kvstore.kvstore_utils.KVStoreData)
39-
* [`KVStoreUtils`](human_protocol_sdk.kvstore.kvstore_utils.md#human_protocol_sdk.kvstore.kvstore_utils.KVStoreUtils)
4035
* [human_protocol_sdk.operator package](human_protocol_sdk.operator.md)
4136
* [Submodules](human_protocol_sdk.operator.md#submodules)
4237
* [human_protocol_sdk.staking package](human_protocol_sdk.staking.md)
@@ -51,6 +46,7 @@ pip install human-protocol-sdk[agreement]
5146
* [human_protocol_sdk.constants module](human_protocol_sdk.constants.md)
5247
* [`ChainId`](human_protocol_sdk.constants.md#human_protocol_sdk.constants.ChainId)
5348
* [`KVStoreKeys`](human_protocol_sdk.constants.md#human_protocol_sdk.constants.KVStoreKeys)
49+
* [`LeaderCategory`](human_protocol_sdk.constants.md#human_protocol_sdk.constants.LeaderCategory)
5450
* [`OrderDirection`](human_protocol_sdk.constants.md#human_protocol_sdk.constants.OrderDirection)
5551
* [`Role`](human_protocol_sdk.constants.md#human_protocol_sdk.constants.Role)
5652
* [`Status`](human_protocol_sdk.constants.md#human_protocol_sdk.constants.Status)

0 commit comments

Comments
 (0)