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

Odis signer refactor #10464

Merged
merged 65 commits into from
Aug 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
65 commits
Select commit Hold shift + click to select a range
98dbf1d
feat: pass fx adapter api keys to oracles (#10443)
philbow61 Aug 3, 2023
196ba83
Fix proxy startup error (#10465)
jcortejoso Aug 4, 2023
3fffa15
Dockerfile including whole monorepo (#10472)
jcortejoso Aug 8, 2023
bd7a802
chore: add usdcbrl and usdceur to rc1 config (#10425)
ninabarbakadze Aug 9, 2023
549a70d
Fix CLI returning zero required votes on proposals with no tx (#10477)
martinvol Aug 10, 2023
8fb4947
fix yarn start
alecps Aug 14, 2023
d31f32d
Merge branch 'master' of github.com:celo-org/celo-monorepo into alecp…
alecps Aug 14, 2023
7a62ef7
dek fetcher
alecps Aug 14, 2023
61465b0
begin signer refactor
alecps Aug 14, 2023
c5ef97d
saving progress
alecps Aug 14, 2023
95d846b
Odis tracing 18 (#10459)
alvarof2 Aug 15, 2023
481ecb1
nicer meter function
mcortesi Aug 15, 2023
634fa4a
fix build
alecps Aug 15, 2023
a759dc6
Merge branch 'alecps/odisRemoveDbLock' of github.com:celo-org/celo-mo…
alecps Aug 15, 2023
043e9ed
Merge branch 'master' of github.com:celo-org/celo-monorepo into alecp…
alecps Aug 15, 2023
e26d478
fix lint and lockfile
alecps Aug 15, 2023
bf1afcf
use new meter
alecps Aug 15, 2023
146666e
remove use of meter()
mcortesi Aug 15, 2023
97c4c3c
Simplify Handler creation
mcortesi Aug 15, 2023
740a9b5
cleanup controller and handler creation
mcortesi Aug 15, 2023
bdd46a0
Move handlers to a new file
mcortesi Aug 15, 2023
56bcccc
wip: tranform actions into handler functions
mcortesi Aug 15, 2023
d4e141f
Several changes
mcortesi Aug 16, 2023
afad289
fix domain tests
mcortesi Aug 16, 2023
5ba28b1
start removing the domain IOs
mcortesi Aug 16, 2023
ad0b4c9
Remove pnpQuota IO
mcortesi Aug 16, 2023
78c67da
Remove pnp sign IO
mcortesi Aug 16, 2023
a3051ff
Disable endpoints on start, not by request
mcortesi Aug 16, 2023
a73c79a
Creates resultHandler, to simplify response management
mcortesi Aug 16, 2023
8318a5f
wip: use resultHandler on pnpSign
mcortesi Aug 16, 2023
ef7c43a
fix sign handler (without rollback)
mcortesi Aug 16, 2023
53a7787
change the flow of pnpSign. remove transaction for whole request
mcortesi Aug 16, 2023
efb5d21
todo list
mcortesi Aug 16, 2023
23b122b
many things
mcortesi Aug 16, 2023
3017c16
Several Changes
mcortesi Aug 17, 2023
0bb1e9c
remove IO in domains
alecps Aug 17, 2023
e41d458
Create Account and Request Services
mcortesi Aug 17, 2023
45c5855
Move account & request services to their own files
mcortesi Aug 17, 2023
702235d
cleanup returned errors for PNP
mcortesi Aug 17, 2023
f302de6
Add caching to AccountService with lru-cache
mcortesi Aug 17, 2023
325064e
Review Tracing: trace only expensive operations
mcortesi Aug 17, 2023
a8b3b14
todo list
alecps Aug 17, 2023
b9818b3
fix domain tests
alecps Aug 17, 2023
4314c4f
factor out resultHandler
alecps Aug 18, 2023
72813b7
fix types
alecps Aug 18, 2023
0820b98
fix traceAsyncFunction
mcortesi Aug 18, 2023
2151be3
Add tracing to sign function, cleanup
mcortesi Aug 18, 2023
fc30fe5
fix error with timeoutHandler, remove catchErrorHandler2
mcortesi Aug 18, 2023
e235a94
fix unused file
mcortesi Aug 18, 2023
447d048
fix combiner compilation issues
mcortesi Aug 18, 2023
3d875cb
fix combiner tests
mcortesi Aug 18, 2023
9b270f2
update todo list, bump signer version for load test, remove unused me…
alecps Aug 18, 2023
5f6b97a
check counters and TODOs
alecps Aug 18, 2023
84af7ed
add back migrations
alecps Aug 18, 2023
0a25e23
bump signer version
alecps Aug 18, 2023
3f8cdd7
migrations
alecps Aug 18, 2023
c9a84a4
bump version
alecps Aug 18, 2023
3393f23
switch order of composite primary keys in requests table
alecps Aug 19, 2023
a18268d
add cancel, isDuplicate always returns false
alecps Aug 19, 2023
bc6bf97
remove trx, add back getRequestExists
alecps Aug 19, 2023
d4bd376
remove cancel, fix test
alecps Aug 19, 2023
97e951a
(to revert) mock db return values for testing
alecps Aug 20, 2023
4cc9071
(to revert) mock out full node queries for testing
alecps Aug 20, 2023
8bbff97
better load test with rps support
mcortesi Aug 21, 2023
a2aa6e1
Merge remote-tracking branch 'origin/alecps/odisRelease3.0.0' into al…
mcortesi Aug 21, 2023
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
6 changes: 5 additions & 1 deletion .env.rc1
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@ AZURE_ORACLE_WESTUS_CELOUSD_ORACLE_ADDRESS_AZURE_KEY_VAULTS=0x0aee051be85ba9c7c1
AZURE_ORACLE_WESTUS_CELOEUR_ORACLE_ADDRESS_AZURE_KEY_VAULTS=0xb8bDBfdd591a5be5980983A7ba1710a5F46f42B5:mainnet-eur-oracle-wus2:mainnet-oracles-westus2,0x929Ad7f2b781CE830014E824CA2eF0b7b8de87C2:mainnet-eur-oracle-wus3:mainnet-oracles-westus2,0xCCC0B54edD8dAe3c15b5C002dd5d348495d4f7fe:mainnet-eur-oracle-wus4:mainnet-oracles-westus2
AZURE_ORACLE_WESTUS_CELOBRL_ORACLE_ADDRESS_AZURE_KEY_VAULTS=0x57d8a7bf9e7f4113c49e077b140fd8e1d7f78a76:mainnet-brl-oracle-wus0:mainnet-oracles-westus2,0x1299dd007cd5120262e546dca893e30d1cff8a10:mainnet-brl-oracle-wus1:mainnet-oracles-westus2,0x116951e440aee97a328614f9937710c9bb2f0839:mainnet-brl-oracle-wus4:mainnet-oracles-westus2
AZURE_ORACLE_WESTUS_USDCUSD_ORACLE_ADDRESS_AZURE_KEY_VAULTS=0x2986c21824c9b804d170270a316ceb07149f79c5:mainnet-usdcusd-wus0,0x09e2e47bb5df7b3464407746970a65c7b02883b3:mainnet-usdcusd-wus1,0xd5e7454932f6e853af849f70044570b62ca2596e:mainnet-usdcusd-wus2,0xfe3276b7142dee2cda34b1d14852eb32f436483d:mainnet-usdcusd-wus3
AZURE_ORACLE_WESTUS_USDCEUR_ORACLE_ADDRESS_AZURE_KEY_VAULTS=0xeccd1e9439094d025ac7d08d16b0bfe0da3bea53:mainnet-usdceur-wus0,0x9b242d2bd848fc92060ca7546033c3af352583d2:mainnet-usdceur-wus1,0x905ab001a9199d45c3f5c7b055b65ace5fc7d70a:mainnet-usdceur-wus2,0xdf5dd31d8f78520185d6a9fb0498c4bbddfe0708:mainnet-usdceur-wus3
AZURE_ORACLE_WESTUS_USDCBRL_ORACLE_ADDRESS_AZURE_KEY_VAULTS=0x8dba01f832c7b0bb5f0bad4efe181cc07f8b322e:mainnet-usdcbrl-wus0,0xffb417d009d09bd1140244e70babbaa52d69ec84:mainnet-usdcbrl-wus1,0x5f755b8350a2e6b8b042cb3e052580e4c5b0ac35:mainnet-usdcbrl-wus2,0x8e1349b48ee82ef5437c912662e6640f3590c6f9:mainnet-usdcbrl-wus3
AZURE_ORACLE_WESTUS_FULL_NODES_COUNT=5
AZURE_ORACLE_WESTUS_FULL_NODES_ROLLING_UPDATE_PARTITION=0
AZURE_ORACLE_WESTUS_FULL_NODES_DISK_SIZE=100
Expand All @@ -101,6 +103,8 @@ AZURE_ORACLE_WESTEUROPE_CELOUSD_ORACLE_ADDRESS_AZURE_KEY_VAULTS=0xfe9925e6ae9c4c
AZURE_ORACLE_WESTEUROPE_CELOEUR_ORACLE_ADDRESS_AZURE_KEY_VAULTS=0x87C45738DAd8Dc3D2b1cCe779E0766329cc408C6:mainnet-eur-oracle-weu0:mainnet-oracles-westeurope,0xeF1E143C554EFC43B0537Af00Ac27C828dE6cF8D:mainnet-eur-oracle-weu1:mainnet-oracles-westeurope,0xF4B4AA107F30206EA019DE145A9b778a220f9fc0:mainnet-eur-oracle-weu2:mainnet-oracles-westeurope,0x24c303e6395DD19806F739619960A311764e3F40:mainnet-eur-oracle-weu3:mainnet-oracles-westeurope,0xDA413875FB45E5905950Bc08a908ebD246Ee6581:mainnet-eur-oracle-weu5:mainnet-oracles-westeurope
AZURE_ORACLE_WESTEUROPE_CELOBRL_ORACLE_ADDRESS_AZURE_KEY_VAULTS=0x3b91bbb873f3b979bd6671dc018d5fc1848882dd:mainnet-brl-oracle-weu0:mainnet-oracles-westeurope,0xc3994b2af0e82490e432d49e9f2246cdfd84da8f:mainnet-brl-oracle-weu1:mainnet-oracles-westeurope,0x9b376b33c33325332df8c6ca951a9896889a6d1e:mainnet-brl-oracle-weu2:mainnet-oracles-westeurope,0x554ba7f4d200c7b233b93b7f2223bc1ea7c467fd:mainnet-brl-oracle-weu3:mainnet-oracles-westeurope,0x535cea1834d6b52e4e9724642fdd7008f569ba5c:mainnet-brl-oracle-weu4:mainnet-oracles-westeurope
AZURE_ORACLE_WESTEUROPE_USDCUSD_ORACLE_ADDRESS_AZURE_KEY_VAULTS=0x477185291403ca2ed5f56d59ed0d568a16222013:mainnet-usdcusd-weu0,0x9a0a52d483c62df76d54f41ab3283cc7cb41ba91:mainnet-usdcusd-weu1,0x2ddb86898a2c2c884fc5cc3ca344898b0170a00d:mainnet-usdcusd-weu2,0x79be0a692e3a4bcd22b96c3e93a108b485becbb2:mainnet-usdcusd-weu3
AZURE_ORACLE_WESTEUROPE_USDCEUR_ORACLE_ADDRESS_AZURE_KEY_VAULTS=0x0781f530100e619936f5b427263441cb0414f885:mainnet-usdceur-weu0,0x55de75fd0c2b37987757172fef7ba2ea935d284d:mainnet-usdceur-weu1,0xdc0c15fa73b13b2e74cd3eced23d8826569904c5:mainnet-usdceur-weu2,0x9048872f739cebbe72825763a1b72064c4df8f1f:mainnet-usdceur-weu3
AZURE_ORACLE_WESTEUROPE_USDCBRL_ORACLE_ADDRESS_AZURE_KEY_VAULTS=0x42b813b9ff8ce8f4837accea26bedda20d7c4982:mainnet-usdcbrl-weu0,0x09208127500963ee1c3af88bfbb3ef0cd34d6eb0:mainnet-usdcbrl-weu1,0xa8f5be092a8452eab98ed1c220d642114bb2731e:mainnet-usdcbrl-weu2,0xfd265c994a5a9c2847fe03a5e878648963f53a37:mainnet-usdcbrl-weu3
AZURE_ORACLE_WESTEUROPE_FULL_NODES_COUNT=5
AZURE_ORACLE_WESTEUROPE_FULL_NODES_ROLLING_UPDATE_PARTITION=0
AZURE_ORACLE_WESTEUROPE_FULL_NODES_DISK_SIZE=100
Expand Down Expand Up @@ -534,4 +538,4 @@ AZURE_KOMENCI_SEA_KOMENCI_NETWORK=rc1
WALLET_CONNECT_IMAGE_REPOSITORY='us.gcr.io/celo-testnet/walletconnect'
WALLET_CONNECT_IMAGE_TAG='1472bcaad57e3746498f7a661c42ff5cf9acaf5a'
WALLET_CONNECT_REDIS_CLUSTER_ENABLED=false
WALLET_CONNECT_REDIS_CLUSTER_USEPASSWORD=false
WALLET_CONNECT_REDIS_CLUSTER_USEPASSWORD=false
40 changes: 40 additions & 0 deletions .github/workflows/container-all-monorepo.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
---
name: Build celo-monorepo container

on:
push:
paths:
- 'dockerfiles/all-monorepo/**'
branches:
- master
pull_request:
paths:
- 'dockerfiles/all-monorepo/**'
workflow_dispatch:

jobs:
celomonorepo-build-dev:
uses: celo-org/reusable-workflows/.github/workflows/[email protected]
name: Build us-west1-docker.pkg.dev/devopsre/dev-images/monorepo:${{ github.sha }}
if: |
github.ref != 'refs/heads/master'
with:
workload-id-provider: projects/1094498259535/locations/global/workloadIdentityPools/gh-celo-monorepo/providers/github-by-repos
service-account: '[email protected]'
artifact-registry: us-west1-docker.pkg.dev/devopsre/dev-images/monorepo
tag: ${{ github.sha }}
context: .
file: dockerfiles/all-monorepo/Dockerfile

celomonorepo-build:
uses: celo-org/reusable-workflows/.github/workflows/[email protected]
name: Build us-west1-docker.pkg.dev/devopsre/celo-monorepo/monorepo:${{ github.sha }}
if: |
github.ref == 'refs/heads/master'
with:
workload-id-provider: projects/1094498259535/locations/global/workloadIdentityPools/gh-celo-monorepo-master/providers/github-by-repos
service-account: '[email protected]'
artifact-registry: us-west1-docker.pkg.dev/devopsre/celo-monorepo/monorepo
tag: ${{ github.sha }}
context: .
file: dockerfiles/all-monorepo/Dockerfile
10 changes: 5 additions & 5 deletions .github/workflows/container-celotool.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
name: Build celo-monorepo container
name: Build celotool container

on:
push:
Expand All @@ -15,26 +15,26 @@ on:
jobs:
celotool-build-dev:
uses: celo-org/reusable-workflows/.github/workflows/[email protected]
name: Build us-west1-docker.pkg.dev/devopsre/dev-images/celotool:testing
name: Build us-west1-docker.pkg.dev/devopsre/dev-images/celotool:${{ github.sha }}
if: |
github.ref != 'refs/heads/master'
with:
workload-id-provider: projects/1094498259535/locations/global/workloadIdentityPools/gh-celo-monorepo/providers/github-by-repos
service-account: '[email protected]'
artifact-registry: us-west1-docker.pkg.dev/devopsre/dev-images/celotool
tag: testing
tag: ${{ github.sha }}
context: .
file: dockerfiles/celotool/Dockerfile

celotool-build:
uses: celo-org/reusable-workflows/.github/workflows/[email protected]
name: Build us-west1-docker.pkg.dev/devopsre/celo-monorepo/celotool:latest
name: Build us-west1-docker.pkg.dev/devopsre/celo-monorepo/celotool:${{ github.sha }}
if: |
github.ref == 'refs/heads/master'
with:
workload-id-provider: projects/1094498259535/locations/global/workloadIdentityPools/gh-celo-monorepo-master/providers/github-by-repos
service-account: '[email protected]'
artifact-registry: us-west1-docker.pkg.dev/devopsre/celo-monorepo/celotool
tag: latest
tag: ${{ github.sha }}
context: .
file: dockerfiles/celotool/Dockerfile
5 changes: 3 additions & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"[typescript]": {
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.organizeImports": true
"source.organizeImports": false
}
},
"[typescriptreact]": {
Expand All @@ -43,5 +43,6 @@
"javascript.format.enable": false,
"editor.tabSize": 2,
"editor.detectIndentation": false,
"tslint.jsEnable": true
"tslint.jsEnable": true,
"typescript.tsdk": "node_modules/typescript/lib"
}
26 changes: 26 additions & 0 deletions dockerfiles/all-monorepo/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
FROM node:18
LABEL org.opencontainers.image.authors="[email protected]"

WORKDIR /celo-monorepo

# Needed for gsutil
RUN apt-get update && \
apt-get install -y lsb-release && \
apt-get install -y curl build-essential git python3 && \
export CLOUD_SDK_REPO="cloud-sdk-$(lsb_release -c -s)" && \
echo "deb http://packages.cloud.google.com/apt $CLOUD_SDK_REPO main" | tee -a /etc/apt/sources.list.d/google-cloud-sdk.list && \
curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add - && \
apt-get update -y && \
apt-get install -y google-cloud-sdk kubectl netcat-openbsd && \
curl https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3 | bash && \
rm -rf /var/lib/apt/lists/*

# ensure yarn.lock is evaluated by kaniko cache diff
COPY . ./

RUN yarn install --network-timeout 100000 --frozen-lockfile && yarn cache clean
RUN yarn build

RUN rm -rf .git
RUN rm -rf .gitmodules

2 changes: 2 additions & 0 deletions dockerfiles/celotool/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
FROM node:18
LABEL org.opencontainers.image.authors="[email protected]"

WORKDIR /celo-monorepo

# Needed for gsutil
Expand Down
1 change: 1 addition & 0 deletions dockerfiles/cli-standalone/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#
# VERSION=x.y.z; docker build . --build-arg VERSION=$VERSION -t gcr.io/celo-testnet/celocli-standalone:$VERSION
FROM node:12-alpine
LABEL org.opencontainers.image.authors="[email protected]"

# Install cli install dependencies.
RUN apk add --no-cache python3 git make gcc g++ bash libusb-dev linux-headers eudev-dev
Expand Down
1 change: 1 addition & 0 deletions dockerfiles/cli/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ RUN npm install @celo/celocli

# Build the combined image
FROM node:12-alpine as final_image
LABEL org.opencontainers.image.authors="[email protected]"

ARG network_name="alfajores"
ARG network_id="44787"
Expand Down
1 change: 1 addition & 0 deletions dockerfiles/phone-number-privacy/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ COPY packages/sdk/wallets/wallet-remote packages/sdk/wallets/wallet-remote

##### Main stage
FROM node:18
LABEL org.opencontainers.image.authors="[email protected]"

WORKDIR /celo-phone-number-privacy/

Expand Down
1 change: 1 addition & 0 deletions packages/celotool/src/lib/env-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ export enum envVar {
ORACLE_DOCKER_IMAGE_REPOSITORY = 'ORACLE_DOCKER_IMAGE_REPOSITORY',
ORACLE_DOCKER_IMAGE_TAG = 'ORACLE_DOCKER_IMAGE_TAG',
ORACLE_UNUSED_ORACLE_ADDRESSES = 'ORACLE_UNUSED_ORACLE_ADDRESSES',
ORACLE_FX_ADAPTERS_API_KEYS = 'ORACLE_FX_ADAPTERS_API_KEYS',
PRIVATE_NODE_DISK_SIZE_GB = 'PRIVATE_NODE_DISK_SIZE_GB',
PRIVATE_TX_NODES = 'PRIVATE_TX_NODES',
PROMETHEUS_DISABLE_STACKDRIVER_SIDECAR = 'PROMETHEUS_DISABLE_STACKDRIVER_SIDECAR',
Expand Down
1 change: 1 addition & 0 deletions packages/celotool/src/lib/k8s-oracle/base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ export abstract class BaseOracleDeployer {
? getFornoWebSocketUrl(this.celoEnv)
: getFullNodeWebSocketRpcInternalUrl(this.celoEnv)
return [
`--set oracle.api_keys=${fetchEnv(envVar.ORACLE_FX_ADAPTERS_API_KEYS)}`,
`--set environment.name=${this.celoEnv}`,
`--set image.repository=${fetchEnv(envVar.ORACLE_DOCKER_IMAGE_REPOSITORY)}`,
`--set image.tag=${fetchEnv(envVar.ORACLE_DOCKER_IMAGE_TAG)}`,
Expand Down
12 changes: 11 additions & 1 deletion packages/celotool/src/lib/oracle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,17 @@ const mnemonicBasedOracleIdentityConfigDynamicEnvVars: {
*/
export function addCurrencyPairMiddleware(argv: yargs.Argv) {
return argv.option('currencyPair', {
choices: ['CELOUSD', 'CELOEUR', 'CELOBRL', 'USDCUSD', 'USDCEUR', 'USDCBRL'],
choices: [
'CELOUSD',
'CELOEUR',
'CELOBRL',
'USDCUSD',
'USDCEUR',
'USDCBRL',
'CELOXOF',
'EUROCXOF',
'EUROCEUR',
],
description: 'Oracle deployment to target based on currency pair',
demandOption: true,
type: 'string',
Expand Down
7 changes: 7 additions & 0 deletions packages/helm-charts/oracle/templates/api_keys-secret.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
apiVersion: v1
kind: Secret
metadata:
name: api-keys
type: Opaque
data:
api_keys: {{ .Values.oracle.api_keys | b64enc }}
5 changes: 5 additions & 0 deletions packages/helm-charts/oracle/templates/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,11 @@ spec:
valueFrom:
fieldRef:
fieldPath: metadata.name
- name: API_KEYS
valueFrom:
secretKeyRef:
key: api_keys
name: api-keys
{{ include "common.env-var" (dict "name" "API_REQUEST_TIMEOUT" "dict" .Values.oracle "value_name" "apiRequestTimeoutMs" "optional" true) | indent 8 }}
{{ include "common.env-var" (dict "name" "AZURE_HSM_INIT_TRY_COUNT" "dict" .Values.oracle.azureHsm "value_name" "initTryCount") | indent 8 }}
{{ include "common.env-var" (dict "name" "AZURE_HSM_INIT_MAX_RETRY_BACKOFF_MS" "dict" .Values.oracle.azureHsm "value_name" "initMaxRetryBackoffMs") | indent 8 }}
Expand Down
8 changes: 5 additions & 3 deletions packages/helm-charts/testnet/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -227,18 +227,20 @@ spec:
echo "Generating proxy enode url pair for proxy $PROXY_INDEX"
PROXY_INTERNAL_IP_ENV_VAR={{ $.Release.Namespace | upper }}_VALIDATORS_${RID}_PROXY_INTERNAL_${PROXY_INDEX}_SERVICE_HOST
echo "PROXY_INTERNAL_IP_ENV_VAR=$PROXY_INTERNAL_IP_ENV_VAR"
PROXY_INTERNAL_IP=$(eval "echo \\${${PROXY_INTERNAL_IP_ENV_VAR}}")
PROXY_INTERNAL_IP=`eval "echo \\${${PROXY_INTERNAL_IP_ENV_VAR}}"`
# If $PROXY_IPS is not empty, then we use the IPs from there. Otherwise,
# we use the IP address of the proxy internal service
if [ ! -z $PROXY_IPS ]; then
echo "Proxy external IP from PROXY_IPS=$PROXY_IPS: "
PROXY_EXTERNAL_IP=$(echo -n $PROXY_IPS | cut -d '/' -f $((PROXY_INDEX + 1)))
PROXY_EXTERNAL_IP=`echo -n $PROXY_IPS | cut -d '/' -f $((PROXY_INDEX + 1))`
else
PROXY_EXTERNAL_IP=$PROXY_INTERNAL_IP
fi
echo "Proxy internal IP: $PROXY_INTERNAL_IP"
echo "Proxy external IP: $PROXY_EXTERNAL_IP"
# Proxy key index to allow for a high number of proxies per validator without overlap
PROXY_KEY_INDEX=$(( ($RID * 10000) + $PROXY_INDEX ))
PROXY_ENODE_ADDRESS=$(celotooljs.sh generate public-key --mnemonic "$MNEMONIC" --accountType proxy --index $PROXY_KEY_INDEX)
PROXY_ENODE_ADDRESS=`celotooljs.sh generate public-key --mnemonic "$MNEMONIC" --accountType proxy --index $PROXY_KEY_INDEX`
PROXY_INTERNAL_ENODE=enode://${PROXY_ENODE_ADDRESS}@${PROXY_INTERNAL_IP}:30503
PROXY_EXTERNAL_ENODE=enode://${PROXY_ENODE_ADDRESS}@${PROXY_EXTERNAL_IP}:30303
echo "Proxy internal enode: $PROXY_INTERNAL_ENODE"
Expand Down
25 changes: 25 additions & 0 deletions packages/phone-number-privacy/TODO.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# TODO

- (alec) fix domains tests
- (Alec) check prometheus Counter
- Fix types in errorResult and sendFailure so we don't have to use ANY
- Refactor domain sign handler to use db transactions properly
- refactor authorization function with the new account model
- resolve FAKE_URL for request url
- Search for TODO comments for things to fix after load test
- (nice to have) Refactor Combiner to be similar than signer (kill IO, Controller, Action)
- Make caching config parameters configurable by environment
- TODO comments

## Done

✔️ extract resultHandler() out of each handler, into the createHandler on server.ts
✔️ correct Locals Type (logger should not be an ANY)
✔️ (mariano) Implement chaching Account Service
✔️ (mariano) Check Tracing Calls
✔️ trace signature timeg
✔️ (Mariano) remove catchErrorHandler2 (move it catchErrorHandler)
✔️ Type Handler so Response has the correct Response Type
✔️ Type Handlers so that Request is the proper type, or better use the "isValid Request" function
✔️ fix primary key in requests table
✔️ drop legacy tables
5 changes: 0 additions & 5 deletions packages/phone-number-privacy/combiner/src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ export const MAX_QUERY_COUNT_DISCREPANCY_THRESHOLD = 5
export interface OdisConfig {
serviceName: string
enabled: boolean
shouldFailOpen: boolean // TODO (https://github.com/celo-org/celo-monorepo/issues/9862) consider refactoring config, this isn't relevant to domains endpoints
odisServices: {
signers: string
timeoutMilliSeconds: number
Expand Down Expand Up @@ -77,7 +76,6 @@ if (DEV_MODE) {
phoneNumberPrivacy: {
serviceName: defaultServiceName,
enabled: true,
shouldFailOpen: false,
odisServices: {
signers: devSignersString,
timeoutMilliSeconds: 5 * 1000,
Expand Down Expand Up @@ -112,7 +110,6 @@ if (DEV_MODE) {
domains: {
serviceName: defaultServiceName,
enabled: true,
shouldFailOpen: false,
odisServices: {
signers: devSignersString,
timeoutMilliSeconds: 5 * 1000,
Expand Down Expand Up @@ -156,7 +153,6 @@ if (DEV_MODE) {
phoneNumberPrivacy: {
serviceName: functionConfig.pnp.service_name ?? defaultServiceName,
enabled: toBool(functionConfig.pnp.enabled, false),
shouldFailOpen: toBool(functionConfig.pnp.should_fail_open, false),
odisServices: {
signers: functionConfig.pnp.odisservices,
timeoutMilliSeconds: functionConfig.pnp.timeout_ms
Expand All @@ -176,7 +172,6 @@ if (DEV_MODE) {
domains: {
serviceName: functionConfig.domains.service_name ?? defaultServiceName,
enabled: toBool(functionConfig.domains.enabled, false),
shouldFailOpen: toBool(functionConfig.domains.auth_should_fail_open, false),
odisServices: {
signers: functionConfig.domains.odisservices,
timeoutMilliSeconds: functionConfig.domains.timeout_ms
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,20 +59,19 @@ export class PnpQuotaIO extends IO<PnpQuotaRequest> {
)
}

async authenticate(
_request: Request<{}, {}, PnpQuotaRequest>,
_logger: Logger
): Promise<boolean> {
async authenticate(request: Request<{}, {}, PnpQuotaRequest>, logger: Logger): Promise<boolean> {
logger.debug({ url: request.url }) // just for ts not to make a fuzz
return Promise.resolve(true)
// return authenticateUser(
// request,
// this.kit,
// logger,
// this.config.shouldFailOpen,
// [],
// this.config.fullNodeTimeoutMs,
// this.config.fullNodeRetryCount,
// this.config.fullNodeRetryDelayMs
// newContractKitFetcher(
// this.kit,
// logger,
// this.config.fullNodeTimeoutMs,
// this.config.fullNodeRetryCount,
// this.config.fullNodeRetryDelayMs
// )
// )
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,13 +80,14 @@ export class PnpSignIO extends IO<SignMessageRequest> {
return Promise.resolve(true)
// return authenticateUser(
// request,
// this.kit,
// logger,
// this.config.shouldFailOpen,
// [],
// this.config.fullNodeTimeoutMs,
// this.config.fullNodeRetryCount,
// this.config.fullNodeRetryDelayMs
// newContractKitFetcher(
// this.kit,
// logger,
// this.config.fullNodeTimeoutMs,
// this.config.fullNodeRetryCount,
// this.config.fullNodeRetryDelayMs
// )
// )
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ export class PnpSignerResponseLogger {
}> = []
session.responses.forEach((response) => {
if (response.res.success) {
const { version, performedQueryCount, totalQuota, blockNumber, warnings } = response.res
const { version, performedQueryCount, totalQuota, warnings } = response.res
parsedResponses.push({
signerUrl: response.url,
values: { version, performedQueryCount, totalQuota, blockNumber, warnings },
values: { version, performedQueryCount, totalQuota, warnings },
})
}
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ export class PnpThresholdStateService<R extends PnpQuotaRequest | SignMessageReq
return {
performedQueryCount: thresholdSigner.performedQueryCount,
totalQuota: thresholdSigner.totalQuota,
blockNumber: thresholdSigner.blockNumber,
}
}
}
Loading
Loading