LIT-Protocol / js-sdk

The Lit Protocol SDK provides developers with a framework for implementing Lit functionality into their own applications.
https://developer.litprotocol.com
MIT License
99 stars 59 forks source link

Feature/3404 datil dev support #515

Closed Ansonhkg closed 2 months ago

Ansonhkg commented 3 months ago

Changelog

πŸš€ Features

πŸ› Bug Fixes

πŸ“š Documentation

βš™οΈ Miscellaneous Tasks

Dev

Description

Installation

yarn add @lit-protocol/lit-node-client@datil-dev

or

yarn add @lit-protocol/lit-node-client@6.1.0-beta.0

Using the datil-dev network

const litNodeClient = new LitNodeClient({
  litNetwork: "datil-dev",
});

await litNodeClient.connect();

Test command:

❗️❗️Note: I'm failing to run the tests in parallel right now, but they work when running individually. I added a CHUNK_SIZE feature which would run parallel execution in chunks and I thought that would fix it, but it seems like it might be RPC rate limit issue instead of nonce? not sure.. still to be investigated...❗️❗️

UPDATE: contract calls still being reverted, but if gasLimit is set to 5 mil, then parallel executions work fine

DEBUG=true NETWORK=datil-dev yarn test:local

Related PRs:

joshLong145 commented 3 months ago

Looks like our tests are failing to stand up with the following error:

Error: No RPC URL found for network "cayenne". Available networks are: localchain, manzano, datil-dev
[41](https://github.com/LIT-Protocol/js-sdk/actions/runs/9719189736/job/26828528874?pr=515#step:6:42)
    at new TinnyEnvironment (file:///home/runner/work/js-sdk/js-sdk/local-tests/build/test.mjs:83469:13)
[42](https://github.com/LIT-Protocol/js-sdk/actions/runs/9719189736/job/26828528874?pr=515#step:6:43)
    at file:///home/runner/work/js-sdk/js-sdk/local-tests/build/test.mjs:89002:18
[43](https://github.com/LIT-Protocol/js-sdk/actions/runs/9719189736/job/26828528874?pr=515#step:6:44)
    at file:///home/runner/work/js-sdk/js-sdk/local-tests/build/test.mjs:89148:3
[44](https://github.com/LIT-Protocol/js-sdk/actions/runs/9719189736/job/26828528874?pr=515#step:6:45)
    at ModuleJob.run (node:internal/modules/esm/module_job:222:25)
[45](https://github.com/LIT-Protocol/js-sdk/actions/runs/9719189736/job/26828528874?pr=515#step:6:46)
    at async ModuleLoader.import (node:internal/modules/esm/loader:316:24)
[46](https://github.com/LIT-Protocol/js-sdk/actions/runs/9719189736/job/26828528874?pr=515#step:6:47)
    at async asyncRunEntryPointWithESMLoader (node:internal/modules/run_main:123:5)

Seems to be missing npc context for the cayenne network? Also wondering if for the short time we are still running tests on deployed networks if we should switch over to datil-dev?

CLAassistant commented 3 months ago

CLA assistant check
All committers have signed the CLA.

DashKash54 commented 3 months ago

Looks like our tests are failing to stand up with the following error:

Error: No RPC URL found for network "cayenne". Available networks are: localchain, manzano, datil-dev
[41](https://github.com/LIT-Protocol/js-sdk/actions/runs/9719189736/job/26828528874?pr=515#step:6:42)
    at new TinnyEnvironment (file:///home/runner/work/js-sdk/js-sdk/local-tests/build/test.mjs:83469:13)
[42](https://github.com/LIT-Protocol/js-sdk/actions/runs/9719189736/job/26828528874?pr=515#step:6:43)
    at file:///home/runner/work/js-sdk/js-sdk/local-tests/build/test.mjs:89002:18
[43](https://github.com/LIT-Protocol/js-sdk/actions/runs/9719189736/job/26828528874?pr=515#step:6:44)
    at file:///home/runner/work/js-sdk/js-sdk/local-tests/build/test.mjs:89148:3
[44](https://github.com/LIT-Protocol/js-sdk/actions/runs/9719189736/job/26828528874?pr=515#step:6:45)
    at ModuleJob.run (node:internal/modules/esm/module_job:222:25)
[45](https://github.com/LIT-Protocol/js-sdk/actions/runs/9719189736/job/26828528874?pr=515#step:6:46)
    at async ModuleLoader.import (node:internal/modules/esm/loader:316:24)
[46](https://github.com/LIT-Protocol/js-sdk/actions/runs/9719189736/job/26828528874?pr=515#step:6:47)
    at async asyncRunEntryPointWithESMLoader (node:internal/modules/run_main:123:5)

Seems to be missing npc context for the cayenne network? Also wondering if for the short time we are still running tests on deployed networks if we should switch over to datil-dev?

How much of a lift will it be to switch the CI tests over to Datil-dev? We should also be mindful that we're gonna use Tinny soon in the CI so maybe this switching to Datil-dev may be a wasted effort for? @joshLong145 @Ansonhkg

MaximusHaximus commented 3 months ago

Pushed commits to resolve a couple of issues:

  1. Tinny can be run against cayenne again πŸŽ‰
  2. Fixed spelling of Chronicle; it had become Chronical in the new code
  3. Adjusted gasLimit on our contracts-sdk calls to a value that appears to be high enough to work on Vesuvius, but low enough that it doesn't exceed the per-block gas limit on Chronicle.

I think this is shippable now :+1: Given Cayenne and Manzano are still functional, ideally we would add GH jobs that run our tests against them -- but Chronicle is so unstable that I am having difficulty running the entire suite against it at all, so maybe moving it to run against datil-dev instead makes the most sense.