Skip to content

Conversation

@GTC6244
Copy link
Contributor

@GTC6244 GTC6244 commented Nov 20, 2025

WHAT

Add threshold enforcement to keysets

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds threshold enforcement to keysets. The changes refactor the root key handling from a HashMap-based approach to a Vec-based approach, simplifying the key share proof checking logic and removing per-keyset iteration in favor of a single validation pass.

  • Refactored root key storage from HashMap<String, Vec<CachedRootKey>> to Vec<CachedRootKey>
  • Updated voting and validation logic to work with the simplified structure
  • Added new error handling for threshold enforcement
  • Updated contract ABIs to support new error types

Reviewed Changes

Copilot reviewed 40 out of 73 changed files in this pull request and generated 45 comments.

Show a summary per file
File Description
rust/lit-node/lit-node/src/tasks/fsm/utils.rs Refactored key share proof checking from keyset-based to single pass validation
rust/lit-node/lit-node/src/tasks/fsm/mod.rs Updated root key handling to use Vec instead of HashMap
rust/lit-node/lit-node/src/tasks/fsm/epoch_change.rs Changed return type to Result and improved error handling
rust/lit-node/lit-node/src/tss/ecdsa_damfast/mod.rs Made root_pubkeys parameter optional
rust/lit-core/lit-blockchain/abis/Staking.json Added CannotKickBelowKeySetThreshold error and reordered NotEnoughValidatorsInNextEpoch
rust/lit-core/Cargo.toml Pinned scc dependency to specific version 3.3.2
rust/lit-node/lit-node/tests/integration/backup_long.rs Updated imports for elliptic_curve crate
rust/lit-node/lit-node/tests/component/sign/ecdsa_damfast.rs Updated function call to pass Option for root keys
rust/lit-core/lit-blockchain/src/contracts/ Updated contract bindings with new bytecode

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

.map_err(|e| unexpected_err(e, Some("Unable to complain".to_string())))?;
} else {
error!(
"Key share proof verification failed for peer {} - curve {}: {:?} - already complainted for this DKG.",
Copy link

Copilot AI Nov 20, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo: "complainted" should be "complained".

Copilot uses AI. Check for mistakes.
import * as fs from 'fs';
import * as path from 'path';
import * as crypto from 'crypto';
import { env } from 'process';
Copy link

Copilot AI Nov 20, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unused import env.

Suggested change
import { env } from 'process';

Copilot uses AI. Check for mistakes.
}
);

const schedulerJob = new gcp.cloudscheduler.Job(
Copy link

Copilot AI Nov 20, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unused variable schedulerJob.

Suggested change
const schedulerJob = new gcp.cloudscheduler.Job(
new gcp.cloudscheduler.Job(

Copilot uses AI. Check for mistakes.
);

// Create the escalations.
const declareIncident = new grafana.oncall.Escalation(
Copy link

Copilot AI Nov 20, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unused variable declareIncident.

Suggested change
const declareIncident = new grafana.oncall.Escalation(
new grafana.oncall.Escalation(

Copilot uses AI. Check for mistakes.

function setupPermissionsForCloudRunJob(cloudRunServiceAccount: Account) {
// Grant the Cloud Run Job's service account the role to publish metrics
const metricWriterRole = new gcp.projects.IAMBinding(
Copy link

Copilot AI Nov 20, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unused variable metricWriterRole.

Suggested change
const metricWriterRole = new gcp.projects.IAMBinding(
new gcp.projects.IAMBinding(

Copilot uses AI. Check for mistakes.
}
);

const sev4OrLessRoute = new grafana.oncall.Route(
Copy link

Copilot AI Nov 20, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unused variable sev4OrLessRoute.

Copilot uses AI. Check for mistakes.
// We only have one route for the Sentry webhook integration since Sentry does not distinguish
// between different severity levels.
// NOTE: We do NOT have a sev1 route at this moment.
const sev4RouteSentry = new grafana.oncall.Route(
Copy link

Copilot AI Nov 20, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unused variable sev4RouteSentry.

Suggested change
const sev4RouteSentry = new grafana.oncall.Route(
new grafana.oncall.Route(

Copilot uses AI. Check for mistakes.
);

// Create routes for the Zendesk webhook integration.
const infraSev2Route = new grafana.oncall.Route(
Copy link

Copilot AI Nov 20, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unused variable infraSev2Route.

Suggested change
const infraSev2Route = new grafana.oncall.Route(
new grafana.oncall.Route(

Copilot uses AI. Check for mistakes.
}
);

const infraSev3Route = new grafana.oncall.Route(
Copy link

Copilot AI Nov 20, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unused variable infraSev3Route.

Copilot uses AI. Check for mistakes.
}
);

const infraSev4OrLessRoute = new grafana.oncall.Route(
Copy link

Copilot AI Nov 20, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unused variable infraSev4OrLessRoute.

Suggested change
const infraSev4OrLessRoute = new grafana.oncall.Route(
new grafana.oncall.Route(

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants