Skip to content
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
e6dc423
Remove traces of custom version upgrade testing.
GTC6244 Jan 6, 2026
40849f4
First few changes - start simplification.
GTC6244 Jan 6, 2026
ae72c84
restore key_types in staking contract, allow validator cloning.
GTC6244 Jan 8, 2026
1cb3927
Update to allow old version to load
GTC6244 Jan 8, 2026
b4ec5d0
Merge branch 'keysets' into feature/node-4923-refactor-upgrade-tests-…
GTC6244 Jan 8, 2026
6edf704
update local builds
GTC6244 Jan 8, 2026
308629a
debugging updates
GTC6244 Jan 8, 2026
5fe91d1
better logging, disable network checks between epoch changes ( for now )
GTC6244 Jan 9, 2026
d00707d
clippy!
GTC6244 Jan 9, 2026
49ba1fd
add a filnal check.
GTC6244 Jan 9, 2026
54a3e1b
Merge branch 'keysets' into feature/node-4923-refactor-upgrade-tests-…
GTC6244 Jan 9, 2026
67908ec
cargo fmt
GTC6244 Jan 9, 2026
ca23a22
clippy.
GTC6244 Jan 9, 2026
9c4aef1
Merge branch 'keysets' into feature/node-4923-refactor-upgrade-tests-…
GTC6244 Jan 9, 2026
14b59e1
Download an install old binaries as required.
GTC6244 Jan 10, 2026
baeb4c3
ignore upgrades by default.
GTC6244 Jan 10, 2026
04fc82a
re-include Pallas curves in deployment scripts.
GTC6244 Jan 10, 2026
dc81384
add functions to create proper upgrade envrionment for old nodes ( r…
GTC6244 Jan 10, 2026
7bc6b64
blockchain abi stales + cargo fmt.
GTC6244 Jan 10, 2026
09c727e
disable test ( with same port )
GTC6244 Jan 10, 2026
745b714
re-add >= to epoch change
GTC6244 Jan 10, 2026
2e64a33
Update contracts to include keysets_deprecated type in tests.
GTC6244 Jan 10, 2026
5c042b8
missing "deprecated" param in test
GTC6244 Jan 11, 2026
f255b07
Merge branch 'keysets' into feature/node-4923-refactor-upgrade-tests-…
GTC6244 Jan 11, 2026
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
1 change: 0 additions & 1 deletion .github/workflows/list-changed-files.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ jobs:
- rust/lit-node/**
- .github/workflows/rust-lit-node-unit-tests.yml
- .github/workflows/rust-lit-node-integration-tests.yml
- .github/workflows/rust-lit-node-version-upgrade-tests.yml
- .github/workflows/rust-lit-node-fault-tests.yml
- .github/workflows/rust-lit-node-long-running-tests.yml
- .github/workflows/rust-lit-node-clippy.yml
Expand Down
119 changes: 1 addition & 118 deletions .github/workflows/rust-lit-node-group-unit-and-integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ on:
- .github/workflows/rust-lit-node-integration-tests.yml
- .github/workflows/rust-lit-node-build.yml
- .github/workflows/rust-lit-node-unit-tests.yml
- .github/workflows/rust-lit-node-version-upgrade-tests.yml
- .github/workflows/rust-lit-node-group-unit-and-integration-tests.yml
- scripts/github/**
branches:
Expand Down Expand Up @@ -164,124 +163,13 @@ jobs:
working-directory: ${{github.workspace}}/rust/lit-node/shiva
- name: Run acceptance, component and integration tests.
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 --"
# after the standard build is done, run the upgrade tests
lit_node_version_upgrade_tests:
needs: build-if-needed
runs-on: warp-ubuntu-latest-x64-16x # 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
# TODO: enable this when you want to turn on version upgrade tests. there's also another spot below where you have to remove a hardcoded "false" with a comment like this.
if: ${{ inputs.enable_version_upgrade_tests }}
timeout-minutes: 60
strategy:
matrix:
partition: [1, 2, 3]

services:
anvil:
image: litptcl/anvil-lit:latest
ports:
- 8545:8545
- 8549:8549
credentials:
username: ${{ vars.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

steps:
- name: Install deps
working-directory: ${{ github.workspace }}
run: sudo apt-get update && sudo apt-get install -y zstd libudev-dev libsqlite3-dev cmake protobuf-compiler
- name: Checkout lit-assets
uses: actions/checkout@v6
with:
fetch-depth: 0
submodules: recursive
- name: Use Node.js
uses: WarpBuilds/setup-node@v4
with:
node-version: 18.17.0
cache: npm
cache-dependency-path: ${{ github.workspace }}/blockchain/contracts/package-lock.json
- name: Install dependencies for blockchain/contracts
working-directory: ${{ github.workspace }}/blockchain/contracts
run: npm install
- name: Run npx hardhat compile for blockchain/contracts
working-directory: ${{ github.workspace }}/blockchain/contracts
run: npx hardhat compile
- name: Install rust because the version upgrade tests do a recompile
uses: dtolnay/rust-toolchain@master
with:
toolchain: '1.91' # keep in sync with rust/lit-node/rust-toolchain.toml
components: rust-src
- name: Install nextest
run: curl -LsSf https://get.nexte.st/latest/linux | tar zxf - -C "${CARGO_HOME:-$HOME/.cargo}/bin"
- name: Download archive
uses: WarpBuilds/cache@v1
with:
path: rust/lit-node/lit-node/nextest-archive.tar.zst
key: nextest-archive-${{ github.sha }}-lit-actions|testing
- name: Unzip archive so that we can get the lit_node binary
run: zstd -d -c nextest-archive.tar.zst | tar xf -
# Get the workflow run that has the latest build for target branches.
- name: Get the latest workflow run ID
id: get_latest_workflow_run_id
run: |
echo "LATEST_WORKFLOW_RUN_ID_HABANERO=$(cd scripts/ci_utils && cargo run --bin get_latest_workflow_run rust/lit-node-build-commit-hash 'origin/release-habanero-*')" >> "$GITHUB_OUTPUT"
echo "LATEST_WORKFLOW_RUN_ID_MANZANO=$(cd scripts/ci_utils && cargo run --bin get_latest_workflow_run rust/lit-node-build-commit-hash 'origin/release-manzano-*')" >> "$GITHUB_OUTPUT"
echo "LATEST_WORKFLOW_RUN_ID_CAYENNE=$(cd scripts/ci_utils && cargo run --bin get_latest_workflow_run rust/lit-node-build-commit-hash 'origin/release-cayenne-*')" >> "$GITHUB_OUTPUT"
env:
GH_PAT: ${{ secrets.GITHUB_TOKEN }}
RUST_LOG: debug
- name: Get the latest commit SHA
id: get_latest_commit_sha
run: |
echo "COMMIT_SHA_HABANERO=$(cd scripts/ci_utils && cargo run --bin get_target_branch_commit_hash 'origin/release-habanero-*')" >> "$GITHUB_OUTPUT"
echo "COMMIT_SHA_MANZANO=$(cd scripts/ci_utils && cargo run --bin get_target_branch_commit_hash 'origin/release-manzano-*')" >> "$GITHUB_OUTPUT"
echo "COMMIT_SHA_CAYENNE=$(cd scripts/ci_utils && cargo run --bin get_target_branch_commit_hash 'origin/release-cayenne-*')" >> "$GITHUB_OUTPUT"
env:
RUST_LOG: debug
- name: Download the latest build for release-habanero-* branch
uses: actions/download-artifact@v7
with:
name: lit_node_${{ steps.get_latest_commit_sha.outputs.COMMIT_SHA_HABANERO }}
run-id: ${{ steps.get_latest_workflow_run_id.outputs.LATEST_WORKFLOW_RUN_ID_HABANERO }}
github-token: ${{ secrets.GITHUB_TOKEN }}
path: rust/lit-node/lit-node/
- name: Move the downloaded binary
run: mv lit_node target/debug/lit_node_${{ steps.get_latest_commit_sha.outputs.COMMIT_SHA_HABANERO }}
- name: Download the latest build for release-manzano-* branch
uses: actions/download-artifact@v7
with:
name: lit_node_${{ steps.get_latest_commit_sha.outputs.COMMIT_SHA_MANZANO }}
run-id: ${{ steps.get_latest_workflow_run_id.outputs.LATEST_WORKFLOW_RUN_ID_MANZANO }}
github-token: ${{ secrets.GITHUB_TOKEN }}
path: rust/lit-node/lit-node/
- name: Move the downloaded binary
run: mv lit_node target/debug/lit_node_${{ steps.get_latest_commit_sha.outputs.COMMIT_SHA_MANZANO }}
- name: Download the latest build for release-cayenne-* branch
uses: actions/download-artifact@v7
with:
name: lit_node_${{ steps.get_latest_commit_sha.outputs.COMMIT_SHA_CAYENNE }}
run-id: ${{ steps.get_latest_workflow_run_id.outputs.LATEST_WORKFLOW_RUN_ID_CAYENNE }}
github-token: ${{ secrets.GITHUB_TOKEN }}
path: rust/lit-node/lit-node/
- name: Move the downloaded binary
run: mv lit_node target/debug/lit_node_${{ steps.get_latest_commit_sha.outputs.COMMIT_SHA_CAYENNE }}
- name: Enable execute permissions for the binary
run: |
chmod +x target/debug/lit_node_${{ steps.get_latest_commit_sha.outputs.COMMIT_SHA_HABANERO }}
chmod +x target/debug/lit_node_${{ steps.get_latest_commit_sha.outputs.COMMIT_SHA_MANZANO }}
chmod +x target/debug/lit_node_${{ steps.get_latest_commit_sha.outputs.COMMIT_SHA_CAYENNE }}
- name: Setup local files for testing
run: make setup-local-files
- name: Run acceptance, component and integration tests.
run: "~/.cargo/bin/cargo-nextest nextest run --archive-file nextest-archive.tar.zst --final-status-level pass --profile version-upgrade-tests -E 'test(/^upgrades/)' --partition count:${{ matrix.partition }}/3 --nocapture --"


# AND together the results
check_status:
needs:
[
lit_node_unit_tests,
lit_node_integration_tests,
lit_node_version_upgrade_tests,
]
runs-on: ubuntu-latest
steps:
Expand All @@ -296,9 +184,4 @@ jobs:
echo "Integration tests failed"
exit 1
fi
# TODO: enable this when you want to turn on version upgrade tests
if false && [ ${{ needs.lit_node_version_upgrade_tests.result }} != 'success' ]; then
echo "Version upgrade tests failed"
exit 1
fi
echo "All tests passed"
10 changes: 10 additions & 0 deletions blockchain/contracts/abis/Staking.abi
Original file line number Diff line number Diff line change
Expand Up @@ -1393,6 +1393,11 @@
"name": "tokenRewardPerTokenPerEpoch",
"type": "uint256"
},
{
"internalType": "uint256[]",
"name": "keyTypes_deprecated",
"type": "uint256[]"
},
{
"internalType": "uint256",
"name": "minimumValidatorCount",
Expand Down Expand Up @@ -5912,6 +5917,11 @@
"name": "tokenRewardPerTokenPerEpoch",
"type": "uint256"
},
{
"internalType": "uint256[]",
"name": "keyTypes_deprecated",
"type": "uint256[]"
},
{
"internalType": "uint256",
"name": "minimumValidatorCount",
Expand Down
1 change: 1 addition & 0 deletions blockchain/contracts/contracts/lit-node/Staking.sol
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ contract Staking {
// Most of this is related to staking / delegation
s.globalConfig[0] = LibStakingStorage.GlobalConfig({
tokenRewardPerTokenPerEpoch: (10 ** 18) / 20, // 18 decimal places in token
keyTypes_deprecated: new uint256[](0),
rewardEpochDuration: 1 hours,
maxTimeLock: 4 * 365 days,
minTimeLock: 90 days,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,7 @@ library LibStakingStorage {

struct GlobalConfig {
uint256 tokenRewardPerTokenPerEpoch;
uint256[] keyTypes_deprecated;
uint256 minimumValidatorCount;
/// @notice Keep this the same as the epoch length for now.
uint256 rewardEpochDuration;
Expand Down
4 changes: 2 additions & 2 deletions blockchain/contracts/scripts/deploy_lit_node_contracts.js
Original file line number Diff line number Diff line change
Expand Up @@ -546,8 +546,8 @@ async function deployLitNodeContracts(deployNodeConfig) {
monetaryValue: 0,
completeIsolation: false,
realms: [1],
curves: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11],
counts: [1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2],
curves: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10],
counts: [1, 2, 2, 2, 2, 2, 2, 2, 2, 2],
recoverySessionId: '0x',
};
tx = await stakingContract.setKeySet(defaultKeysetConfig);
Expand Down
4 changes: 2 additions & 2 deletions rust/lit-core/lit-blockchain-lite/abis/PKPHelper.json

Large diffs are not rendered by default.

10 changes: 10 additions & 0 deletions rust/lit-core/lit-blockchain-lite/abis/Staking.json
Original file line number Diff line number Diff line change
Expand Up @@ -1397,6 +1397,11 @@
"name": "tokenRewardPerTokenPerEpoch",
"type": "uint256"
},
{
"internalType": "uint256[]",
"name": "keyTypes_deprecated",
"type": "uint256[]"
},
{
"internalType": "uint256",
"name": "minimumValidatorCount",
Expand Down Expand Up @@ -5916,6 +5921,11 @@
"name": "tokenRewardPerTokenPerEpoch",
"type": "uint256"
},
{
"internalType": "uint256[]",
"name": "keyTypes_deprecated",
"type": "uint256[]"
},
{
"internalType": "uint256",
"name": "minimumValidatorCount",
Expand Down
4 changes: 2 additions & 2 deletions rust/lit-core/lit-blockchain-lite/src/contracts/pkp_helper.rs

Large diffs are not rendered by default.

21 changes: 16 additions & 5 deletions rust/lit-core/lit-blockchain-lite/src/contracts/staking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3539,6 +3539,11 @@ abi_functions.append(&mut __abi_functions_4());
kind: ::ethers::core::abi::ethabi::ParamType::Tuple(
::std::vec![
::ethers::core::abi::ethabi::ParamType::Uint(256usize),
::ethers::core::abi::ethabi::ParamType::Array(
::std::boxed::Box::new(
::ethers::core::abi::ethabi::ParamType::Uint(256usize),
),
),
::ethers::core::abi::ethabi::ParamType::Uint(256usize),
::ethers::core::abi::ethabi::ParamType::Uint(256usize),
::ethers::core::abi::ethabi::ParamType::Uint(256usize),
Expand Down Expand Up @@ -5121,6 +5126,11 @@ abi_functions.append(&mut __abi_functions_4());
kind: ::ethers::core::abi::ethabi::ParamType::Tuple(
::std::vec![
::ethers::core::abi::ethabi::ParamType::Uint(256usize),
::ethers::core::abi::ethabi::ParamType::Array(
::std::boxed::Box::new(
::ethers::core::abi::ethabi::ParamType::Uint(256usize),
),
),
::ethers::core::abi::ethabi::ParamType::Uint(256usize),
::ethers::core::abi::ethabi::ParamType::Uint(256usize),
::ethers::core::abi::ethabi::ParamType::Uint(256usize),
Expand Down Expand Up @@ -10327,13 +10337,13 @@ abi_errors.append(&mut __abi_errors_2());
.method_hash([68, 14, 141, 34], (reason, config))
.expect("method not found (this should never happen)")
}
///Calls the contract's `setConfig` (0xd94c412d) function
///Calls the contract's `setConfig` (0x077b0d40) function
pub fn set_config(
&self,
new_config: GlobalConfig,
) -> ::ethers::contract::builders::ContractCall<M, ()> {
self.0
.method_hash([217, 76, 65, 45], (new_config,))
.method_hash([7, 123, 13, 64], (new_config,))
.expect("method not found (this should never happen)")
}
///Calls the contract's `setContractResolver` (0xf95d71b1) function
Expand Down Expand Up @@ -17783,7 +17793,7 @@ abi_errors.append(&mut __abi_errors_2());
pub reason: ::ethers::core::types::U256,
pub config: ComplaintConfig,
}
///Container type for all input parameters for the `setConfig` function with signature `setConfig((uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,bool,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256))` and selector `0xd94c412d`
///Container type for all input parameters for the `setConfig` function with signature `setConfig((uint256,uint256[],uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,bool,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256))` and selector `0x077b0d40`
#[derive(
Clone,
::ethers::contract::EthCall,
Expand All @@ -17793,7 +17803,7 @@ abi_errors.append(&mut __abi_errors_2());
)]
#[ethcall(
name = "setConfig",
abi = "setConfig((uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,bool,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256))"
abi = "setConfig((uint256,uint256[],uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,bool,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256))"
)]
pub struct SetConfigCall {
pub new_config: GlobalConfig,
Expand Down Expand Up @@ -23015,7 +23025,7 @@ abi_errors.append(&mut __abi_errors_2());
pub start_time: ::ethers::core::types::U256,
pub last_advance_vote_time: ::ethers::core::types::U256,
}
///`GlobalConfig(uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,bool,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256)`
///`GlobalConfig(uint256,uint256[],uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,bool,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256)`
#[derive(
Clone,
::ethers::contract::EthAbiType,
Expand All @@ -23030,6 +23040,7 @@ abi_errors.append(&mut __abi_errors_2());
)]
pub struct GlobalConfig {
pub token_reward_per_token_per_epoch: ::ethers::core::types::U256,
pub key_types_deprecated: ::std::vec::Vec<::ethers::core::types::U256>,
pub minimum_validator_count: ::ethers::core::types::U256,
pub reward_epoch_duration: ::ethers::core::types::U256,
pub max_time_lock: ::ethers::core::types::U256,
Expand Down
4 changes: 2 additions & 2 deletions rust/lit-core/lit-blockchain/abis/PKPHelper.json

Large diffs are not rendered by default.

10 changes: 10 additions & 0 deletions rust/lit-core/lit-blockchain/abis/Staking.json
Original file line number Diff line number Diff line change
Expand Up @@ -1397,6 +1397,11 @@
"name": "tokenRewardPerTokenPerEpoch",
"type": "uint256"
},
{
"internalType": "uint256[]",
"name": "keyTypes_deprecated",
"type": "uint256[]"
},
{
"internalType": "uint256",
"name": "minimumValidatorCount",
Expand Down Expand Up @@ -5916,6 +5921,11 @@
"name": "tokenRewardPerTokenPerEpoch",
"type": "uint256"
},
{
"internalType": "uint256[]",
"name": "keyTypes_deprecated",
"type": "uint256[]"
},
{
"internalType": "uint256",
"name": "minimumValidatorCount",
Expand Down
4 changes: 2 additions & 2 deletions rust/lit-core/lit-blockchain/src/contracts/pkp_helper.rs

Large diffs are not rendered by default.

Loading
Loading