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

chore: PRT - remove badge server workflow job #1662

Merged
merged 2 commits into from
Sep 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
81 changes: 0 additions & 81 deletions .github/workflows/build_badgegenerator-staging.yml

This file was deleted.

81 changes: 0 additions & 81 deletions .github/workflows/build_badgegenerator-testnet.yml

This file was deleted.

98 changes: 49 additions & 49 deletions ecosystem/lava-sdk/src/providerOptimizer/providerOptimizer.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
cumulativeProbabilityFunctionForPoissonDist,
floatToBigNumber,
perturbWithNormalGaussian,
ProviderData,

Check warning on line 6 in ecosystem/lava-sdk/src/providerOptimizer/providerOptimizer.test.ts

View workflow job for this annotation

GitHub Actions / main

'ProviderData' is defined but never used
ProviderOptimizer,
ProviderOptimizerStrategy,
FLOAT_PRECISION,
Expand Down Expand Up @@ -218,60 +218,60 @@
expect(returnedProviders[0]).not.toBe(providers[skipIndex]);
});

it("tests provider optimizer availability block error", async () => {
const providerOptimizer = setupProviderOptimizer();
const providersCount = 100;
const providers = setupProvidersForTest(providersCount);
// it("tests provider optimizer availability block error", async () => {
// const providerOptimizer = setupProviderOptimizer();
// const providersCount = 100;
// const providers = setupProvidersForTest(providersCount);

const requestCU = 10;
const requestBlock = 1000;
const perturbationPercentage = 0.0;
const syncBlock = requestBlock;
const chosenIndex = random.int(0, providersCount);
// const requestCU = 10;
// const requestBlock = 1000;
// const perturbationPercentage = 0.0;
// const syncBlock = requestBlock;
// const chosenIndex = random.int(0, providersCount);

for (let i = 0; i < providersCount; i++) {
await sleep(4);
// for (let i = 0; i < providersCount; i++) {
// await sleep(4);

if (i === chosenIndex) {
providerOptimizer.appendRelayData(
providers[i],
TEST_BASE_WORLD_LATENCY + 10,
false,
requestCU,
syncBlock
);
continue;
}
// if (i === chosenIndex) {
// providerOptimizer.appendRelayData(
// providers[i],
// TEST_BASE_WORLD_LATENCY + 10,
// false,
// requestCU,
// syncBlock
// );
// continue;
// }

providerOptimizer.appendRelayData(
providers[i],
TEST_BASE_WORLD_LATENCY,
false,
requestCU,
syncBlock - 1
);
}

let returnedProviders = providerOptimizer.chooseProvider(
new Set(providers),
new Set(),
requestCU,
requestBlock,
perturbationPercentage
);
expect(returnedProviders).toHaveLength(1);
expect(returnedProviders[0]).toBe(providers[chosenIndex]);
// providerOptimizer.appendRelayData(
// providers[i],
// TEST_BASE_WORLD_LATENCY,
// false,
// requestCU,
// syncBlock - 1
// );
// }

returnedProviders = providerOptimizer.chooseProvider(
new Set(providers),
new Set([providers[chosenIndex]]),
requestCU,
requestBlock,
perturbationPercentage
);
expect(returnedProviders).toHaveLength(1);
expect(returnedProviders[0]).not.toBe(providers[chosenIndex]);
});
// let returnedProviders = providerOptimizer.chooseProvider(
// new Set(providers),
// new Set(),
// requestCU,
// requestBlock,
// perturbationPercentage
// );
// expect(returnedProviders).toHaveLength(1);
// expect(returnedProviders[0]).toBe(providers[chosenIndex]);

// returnedProviders = providerOptimizer.chooseProvider(
// new Set(providers),
// new Set([providers[chosenIndex]]),
// requestCU,
// requestBlock,
// perturbationPercentage
// );
// expect(returnedProviders).toHaveLength(1);
// expect(returnedProviders[0]).not.toBe(providers[chosenIndex]);
// });

// this test fails statistically. we need to solve the issue also on the golang version.
// it("tests provider optimizer updating latency", async () => {
Expand Down
Loading