Skip to content

Commit e8075c3

Browse files
authored
Feature/node 4940 fix keyset ci times (#76)
* Make datil always available, even if not used. * Add debugging. * update build.rs * debugging * Test / Refactor / Discover - anvil cache issues. * rename to edge testing, add a matrix * clippy ! * test splitting out the edge related tests. * cargo fmt * config update (nomenclature, mainly) * Use an updated version of datil contracts that can be properly cleared of root keys. * remove unit test partitioning * add debugging info * Add keyset into ClientBuilder. * force deploy for the child lit action function.
1 parent 5e850d1 commit e8075c3

File tree

30 files changed

+689
-844
lines changed

30 files changed

+689
-844
lines changed

.github/workflows/rust-lit-node-group-unit-and-integration-tests.yml

Lines changed: 60 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ jobs:
5454
lit_node_unit_tests:
5555
needs: build-if-needed
5656
runs-on: warp-ubuntu-latest-x64-8x # change to LargeRunner to run on github. Change to self-hosted to run on our own runner. Change to buildjet-8vcpu-ubuntu-2204 to run on buildjet with 8 cpus
57-
timeout-minutes: 40
57+
timeout-minutes: 30
5858

5959
services:
6060
anvil:
@@ -105,7 +105,62 @@ jobs:
105105
timeout-minutes: 45
106106
strategy:
107107
matrix:
108-
partition: [1, 2, 3]
108+
partition: [1, 2, 3, 4]
109+
110+
services:
111+
anvil:
112+
image: litptcl/anvil-lit:latest
113+
ports:
114+
- 8545:8545
115+
- 8549:8549
116+
credentials:
117+
username: ${{ vars.DOCKERHUB_USERNAME }}
118+
password: ${{ secrets.DOCKERHUB_TOKEN }}
119+
120+
steps:
121+
- name: Install deps
122+
working-directory: ${{ github.workspace }}
123+
run: sudo apt-get update && sudo apt-get install -y zstd libudev-dev libsqlite3-dev cmake protobuf-compiler
124+
- name: Checkout lit-assets
125+
uses: actions/checkout@v6
126+
with:
127+
submodules: recursive
128+
- uses: de-vri-es/setup-git-credentials@v2
129+
with:
130+
credentials: https://glitch003:${{secrets.READ_ONLY_PAT}}@github.com/
131+
- name: Use Node.js
132+
uses: WarpBuilds/setup-node@v4
133+
with:
134+
node-version: 18.17.0
135+
cache: npm
136+
cache-dependency-path: ${{ github.workspace }}/blockchain/contracts/package-lock.json
137+
- name: Install dependencies for blockchain/contracts
138+
working-directory: ${{ github.workspace }}/blockchain/contracts
139+
run: npm install
140+
- name: Run npx hardhat compile for blockchain/contracts
141+
working-directory: ${{ github.workspace }}/blockchain/contracts
142+
run: npx hardhat compile
143+
- run: mkdir -p ~/.cargo/bin
144+
- name: Install nextest
145+
run: curl -LsSf https://get.nexte.st/latest/linux | tar zxf - -C "${CARGO_HOME:-$HOME/.cargo}/bin"
146+
- name: Download archive
147+
uses: WarpBuilds/cache@v1
148+
with:
149+
path: rust/lit-node/lit-node/nextest-archive.tar.zst
150+
key: nextest-archive-${{ github.sha }}-lit-actions|testing
151+
- name: Unzip archive so that we can get the lit_node binary
152+
run: zstd -d -c nextest-archive.tar.zst | tar xf -
153+
- name: Setup local files for testing
154+
run: make setup-local-files
155+
- name: Run acceptance, component and integration tests.
156+
run: "~/.cargo/bin/cargo-nextest nextest run --archive-file nextest-archive.tar.zst --final-status-level pass --profile integration-tests -E 'test(/^acceptance|^component|^integration|^sdk/) - test(/long/)' --partition count:${{ matrix.partition }}/4 --nocapture --"
157+
158+
159+
# after the standard build is done, run the other integration tests
160+
lit_node_other_tests:
161+
needs: build-if-needed
162+
runs-on: warp-ubuntu-latest-x64-8x # change to LargeRunner to run on github. Change to self-hosted to run on our own runner. Change to buildjet-8vcpu-ubuntu-2204 to run on buildjet with 8 cpus
163+
timeout-minutes: 45
109164

110165
services:
111166
anvil:
@@ -162,14 +217,16 @@ jobs:
162217
cargo nextest run --final-status-level pass --no-capture --
163218
working-directory: ${{github.workspace}}/rust/lit-node/shiva
164219
- name: Run acceptance, component and integration tests.
165-
run: "~/.cargo/bin/cargo-nextest nextest run --archive-file nextest-archive.tar.zst --final-status-level pass --profile integration-tests -E 'test(/^acceptance|^component|^integration|^sdk/) - test(/long/)' --partition count:${{ matrix.partition }}/3 --nocapture --"
220+
run: "~/.cargo/bin/cargo-nextest nextest run --archive-file nextest-archive.tar.zst --final-status-level pass --profile integration-tests -E 'test(/^edge/) - test(/long/)' --nocapture --"
221+
166222

167223
# AND together the results
168224
check_status:
169225
needs:
170226
[
171227
lit_node_unit_tests,
172228
lit_node_integration_tests,
229+
lit_node_other_tests,
173230
]
174231
runs-on: ubuntu-latest
175232
steps:

rust/lit-node/Cargo.lock

Lines changed: 19 additions & 85 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

rust/lit-node/lit-node-testnet/src/end_user/datil_pkp.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,6 @@ impl Pkp {
1717

1818
let pkpnft_address = end_user.actions().datil_contracts().pkpnft.address();
1919

20-
info!(
21-
"Datil signing provider: {:?}",
22-
end_user.datil_signing_provider()
23-
);
24-
2520
let client = Arc::new(SignerMiddleware::new(
2621
end_user.datil_signing_provider(),
2722
end_user.wallet.clone(),

rust/lit-node/lit-node-testnet/src/end_user/mod.rs

Lines changed: 6 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ pub struct EndUser {
2626
actions: Actions,
2727
pkps: Vec<Pkp>,
2828
provider: Arc<Provider<Http>>,
29-
datil_provider: Option<Arc<Provider<Http>>>,
29+
datil_provider: Arc<Provider<Http>>,
3030
}
3131

3232
#[derive(Debug, Clone)]
@@ -45,12 +45,7 @@ impl EndUser {
4545
let new_wallet = LocalWallet::new(&mut OsRng).with_chain_id(testnet.chain_id);
4646

4747
let provider = testnet.provider.clone();
48-
49-
let datil_provider = if testnet.datil_testnet.is_some() {
50-
Some(testnet.datil_testnet.as_ref().unwrap().provider.clone())
51-
} else {
52-
None
53-
};
48+
let datil_provider = testnet.datil_testnet.provider.clone();
5449

5550
info!("New wallet: {:?}", new_wallet.address());
5651
Self {
@@ -97,11 +92,9 @@ impl EndUser {
9792
self.set_wallet_balance_with_provider(provider, amount)
9893
.await;
9994

100-
if self.datil_provider.is_some() {
101-
let provider = self.datil_provider.as_ref().unwrap().clone();
102-
self.set_wallet_balance_with_provider(provider, amount)
103-
.await;
104-
}
95+
let provider = self.datil_provider.clone();
96+
self.set_wallet_balance_with_provider(provider, amount)
97+
.await;
10598
}
10699

107100
async fn set_wallet_balance_with_provider(&self, provider: Arc<Provider<Http>>, amount: &str) {
@@ -228,12 +221,8 @@ impl EndUser {
228221
pub fn datil_signing_provider(
229222
&self,
230223
) -> Arc<SignerMiddleware<Arc<Provider<Http>>, Wallet<SigningKey>>> {
231-
if self.datil_provider.is_none() {
232-
panic!("Secondary Datil network not found.");
233-
}
234-
235224
Arc::new(SignerMiddleware::new(
236-
self.datil_provider.as_ref().unwrap().clone(),
225+
self.datil_provider.clone(),
237226
self.wallet.clone(),
238227
))
239228
}

0 commit comments

Comments
 (0)