Skip to content

Commit c43c790

Browse files
authored
Merge pull request #864 from LIT-Protocol/feature/jss-37-optimisation-unify-shared-logic-with-an-option-to-override
[Refactor] Create shared directory for all network environments
2 parents a2e3afe + 862473d commit c43c790

File tree

370 files changed

+2863
-46182
lines changed

Some content is hidden

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

370 files changed

+2863
-46182
lines changed

.changeset/cute-experts-clap.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
---
2+
'@lit-protocol/access-control-conditions': patch
3+
'@lit-protocol/access-control-conditions-schemas': patch
4+
'@lit-protocol/auth': patch
5+
'@lit-protocol/auth-helpers': patch
6+
'@lit-protocol/auth-services': patch
7+
'@lit-protocol/constants': patch
8+
'@lit-protocol/crypto': patch
9+
'@lit-protocol/lit-client': patch
10+
'@lit-protocol/logger': patch
11+
'@lit-protocol/networks': patch
12+
'@lit-protocol/schemas': patch
13+
'@lit-protocol/types': patch
14+
'@lit-protocol/wasm': patch
15+
'@lit-protocol/wrapped-keys': patch
16+
'@lit-protocol/wrapped-keys-lit-actions': patch
17+
---
18+
19+
Initial version after networks unification

.changeset/cyan-bears-invent.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
---
2+
'@lit-protocol/access-control-conditions': patch
3+
'@lit-protocol/access-control-conditions-schemas': patch
4+
'@lit-protocol/auth': patch
5+
'@lit-protocol/auth-helpers': patch
6+
'@lit-protocol/auth-services': patch
7+
'@lit-protocol/constants': patch
8+
'@lit-protocol/crypto': patch
9+
'@lit-protocol/lit-client': patch
10+
'@lit-protocol/logger': patch
11+
'@lit-protocol/networks': patch
12+
'@lit-protocol/schemas': patch
13+
'@lit-protocol/types': patch
14+
'@lit-protocol/wasm': patch
15+
'@lit-protocol/wrapped-keys': patch
16+
'@lit-protocol/wrapped-keys-lit-actions': patch
17+
---
18+
19+
Initial release for networks unification

.changeset/pre.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,5 @@
1818
"@lit-protocol/wrapped-keys": "7.0.0",
1919
"@lit-protocol/wrapped-keys-lit-actions": "7.0.0"
2020
},
21-
"changesets": ["cute-bottles-ask"]
21+
"changesets": ["cute-bottles-ask", "cute-experts-clap", "cyan-bears-invent"]
2222
}

.env.sample

Lines changed: 7 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,8 @@
1-
#Tinny ENV Vars
2-
MAX_ATTEMPTS=1
3-
NETWORK=datil-dev
4-
DEBUG=true
5-
WAIT_FOR_KEY_INTERVAL=3000
6-
LIT_OFFICAL_RPC=https://chain-rpc.litprotocol.com/http
7-
TIME_TO_RELEASE_KEY=10000
8-
RUN_IN_BAND=true
9-
RUN_IN_BAND_INTERVAL=5000
10-
PRIVATE_KEYS="0x59c6995e998f97a5a0044966f0945389dc9e86dae88c7a8412f4603b6b78690d,0x5de4111afa1a4b94908f83103eb1f1706367c2e68ca870fc3fb9a804cdab365a,0x7c852118294e51e653712a81e05800f419141751be58f605c371e15141b007a6,0x47e179ec197488593b187f80a00eb0da91f1b9d0b13f8733639f19c30a34926a,0x8b3a350cf5c34c9194ca85829a2df0ec3153be0318b5e2d3348e872092edffba,0x92db14e403b83dfe3df233f83dfa3a0d7096f21ca9b0d6d6b8d88b2b4ec1564e,0x4bbbf85ce3377467afe5d46f804f221813b2bb87f24d81f60f1fcdbf7cbf4356,0xdbda1821b80551c9d65939329250298aa3472ba22feea921c0cf5d620ea67b97,0x2a871d0798f97d79848a013d4936a73bf4cc922c825d33c1cf7073dff6d409c6"
11-
NO_SETUP=false
12-
USE_SHIVA=false
13-
NETWORK_CONFIG=./networkContext.json
14-
TEST_TIMEOUT=45000
1+
# LIT_YELLOWSTONE_PRIVATE_RPC_URL=<OVERWRITE ME>
2+
# LOCAL_RPC_URL=<OVERWRITE ME>
153

16-
#Shiva Client ENV Vars
17-
STOP_TESTNET=false
18-
TESTNET_MANAGER_URL=http://0.0.0.0:8000
19-
USE_LIT_BINARIES=true
20-
LIT_NODE_BINARY_PATH=/path/to/lit_node/binary
21-
LIT_ACTION_BINARY_PATH=/path/to/lit_action_binary
4+
LOG_LEVEL=silent
5+
LIVE_MASTER_ACCOUNT=
6+
LOCAL_MASTER_ACCOUNT=0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80
7+
8+
NODE_NO_WARNINGS=1

.github/workflows/e2e.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,13 +48,13 @@ jobs:
4848
run: bun run build
4949

5050
- name: Run health check for naga-dev
51-
run: NETWORK=naga-dev bun run test:e2e all --timeout 5000000
51+
run: NETWORK=naga-dev bun run test:e2e all
5252
timeout-minutes: 10
5353

5454
- name: Run health check for naga-test
55-
run: NETWORK=naga-test bun run test:e2e all --timeout 5000000
55+
run: NETWORK=naga-test bun run test:e2e all
5656
timeout-minutes: 10
5757

5858
- name: Run health check for naga-staging
59-
run: NETWORK=naga-staging bun run test:e2e all --timeout 5000000
59+
run: NETWORK=naga-staging bun run test:e2e all
6060
timeout-minutes: 10
Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
11
config:
2-
target: "dummy"
2+
target: 'dummy'
33
phases:
44
# Over 60s, ramp up to creating 50 vusers per second
55
- duration: 60
66
arrivalRate: 5
77
rampTo: 150
8-
name: "Ramp Up"
8+
name: 'Ramp Up'
99
# Over 300s, create 50 vusers per second
1010
- duration: 300
1111
arrivalRate: 150
12-
name: "Sustained Encrypt & Decrypt"
12+
name: 'Sustained Encrypt & Decrypt'
1313
# Over 60s, ramp down to creating 5 vusers per second
1414
- duration: 60
1515
arrivalRate: 20
16-
name: "Ramp Down"
17-
processor: "../src/processors/multi-endpoints.ts"
16+
name: 'Ramp Down'
17+
processor: '../src/processors/multi-endpoints.ts'
1818

1919
scenarios:
20-
- name: "Encrypt & Decrypt Stress Test"
20+
- name: 'Encrypt & Decrypt Stress Test'
2121
weight: 100
2222
flow:
23-
- function: "runEncryptDecryptTest"
24-
- think: 0.1
23+
- function: 'runEncryptDecryptTest'
24+
- think: 0.1

e2e/artillery/configs/execute.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
11
config:
2-
target: "dummy"
2+
target: 'dummy'
33
phases:
44
# Over 60s, ramp up to creating 50 vusers per second
55
- duration: 60
66
arrivalRate: 5
77
rampTo: 100
8-
name: "Ramp Up"
8+
name: 'Ramp Up'
99
# Over 300s, create 50 vusers per second
1010
- duration: 300
1111
arrivalRate: 100
12-
name: "Sustained Encrypt & Decrypt"
12+
name: 'Sustained Encrypt & Decrypt'
1313
# Over 60s, ramp down to creating 5 vusers per second
1414
- duration: 60
1515
arrivalRate: 20
16-
name: "Ramp Down"
17-
processor: "../src/processors/multi-endpoints.ts"
16+
name: 'Ramp Down'
17+
processor: '../src/processors/multi-endpoints.ts'
1818

1919
scenarios:
20-
- name: "Execute JS Stress Test"
20+
- name: 'Execute JS Stress Test'
2121
weight: 100
2222
flow:
23-
- function: "runExecuteJSTest"
24-
- think: 0.1
23+
- function: 'runExecuteJSTest'
24+
- think: 0.1

e2e/artillery/configs/mix.yml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,34 @@
11
config:
2-
target: "dummy"
2+
target: 'dummy'
33
phases:
44
# Over 60s, ramp up to creating 50 vusers per second
55
- duration: 60
66
arrivalRate: 5
77
rampTo: 75
8-
name: "Ramp Up"
8+
name: 'Ramp Up'
99
# Over 300s, create 50 vusers per second
1010
- duration: 300
1111
arrivalRate: 75
12-
name: "Sustained Encrypt & Decrypt"
12+
name: 'Sustained Encrypt & Decrypt'
1313
# Over 60s, ramp down to creating 5 vusers per second
1414
- duration: 60
1515
arrivalRate: 20
16-
name: "Ramp Down"
17-
processor: "../src/processors/multi-endpoints.ts"
16+
name: 'Ramp Down'
17+
processor: '../src/processors/multi-endpoints.ts'
1818

1919
scenarios:
20-
- name: "PKP Sign Stress Test"
20+
- name: 'PKP Sign Stress Test'
2121
weight: 50
2222
flow:
23-
- function: "runPkpSignTest"
23+
- function: 'runPkpSignTest'
2424
- think: 0.1
25-
- name: "Encrypt & Decrypt Stress Test"
25+
- name: 'Encrypt & Decrypt Stress Test'
2626
weight: 25
2727
flow:
28-
- function: "runEncryptDecryptTest"
28+
- function: 'runEncryptDecryptTest'
2929
- think: 0.1
30-
- name: "Execute JS Stress Test"
30+
- name: 'Execute JS Stress Test'
3131
weight: 25
3232
flow:
33-
- function: "runExecuteJSTest"
34-
- think: 0.1
33+
- function: 'runExecuteJSTest'
34+
- think: 0.1

e2e/artillery/configs/pkp-sign.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ config:
55
- duration: 60
66
arrivalRate: 5
77
rampTo: 80
8-
name: "Ramp Up"
8+
name: 'Ramp Up'
99
# Over 300s, create 50 vusers per second
1010
- duration: 300
1111
arrivalRate: 80
12-
name: "Sustained PKP Signing"
12+
name: 'Sustained PKP Signing'
1313
# Over 60s, ramp down to creating 5 vusers per second
1414
- duration: 60
1515
arrivalRate: 20

e2e/src/helper/NetworkManager.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,12 @@ export const getViemPublicClient = async ({
5050
networkModule: any;
5151
}) => {
5252
const viemChainConfig = networkModule.getChainConfig();
53+
const defaultRpcUrl = viemChainConfig.rpcUrls.default.http[0];
54+
const isLocalNetwork = defaultRpcUrl.includes('127.0.0.1');
55+
const customRpcUrl = isLocalNetwork
56+
? process.env['LOCAL_RPC_URL']
57+
: process.env['LIT_YELLOWSTONE_PRIVATE_RPC_URL'];
5358

54-
const customRpcUrl = process.env['LIT_YELLOWSTONE_PRIVATE_RPC_URL'];
5559
if (customRpcUrl) {
5660
console.log(`🔧 Using custom E2E RPC URL: ***${customRpcUrl.slice(-6)}`);
5761
}

0 commit comments

Comments
 (0)