-
Notifications
You must be signed in to change notification settings - Fork 0
Threshold enforcement #12
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
base: keysets
Are you sure you want to change the base?
Conversation
There was a problem hiding this 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>>toVec<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.", |
Copilot
AI
Nov 20, 2025
There was a problem hiding this comment.
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".
| import * as fs from 'fs'; | ||
| import * as path from 'path'; | ||
| import * as crypto from 'crypto'; | ||
| import { env } from 'process'; |
Copilot
AI
Nov 20, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unused import env.
| import { env } from 'process'; |
| } | ||
| ); | ||
|
|
||
| const schedulerJob = new gcp.cloudscheduler.Job( |
Copilot
AI
Nov 20, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unused variable schedulerJob.
| const schedulerJob = new gcp.cloudscheduler.Job( | |
| new gcp.cloudscheduler.Job( |
| ); | ||
|
|
||
| // Create the escalations. | ||
| const declareIncident = new grafana.oncall.Escalation( |
Copilot
AI
Nov 20, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unused variable declareIncident.
| const declareIncident = new grafana.oncall.Escalation( | |
| new grafana.oncall.Escalation( |
|
|
||
| function setupPermissionsForCloudRunJob(cloudRunServiceAccount: Account) { | ||
| // Grant the Cloud Run Job's service account the role to publish metrics | ||
| const metricWriterRole = new gcp.projects.IAMBinding( |
Copilot
AI
Nov 20, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unused variable metricWriterRole.
| const metricWriterRole = new gcp.projects.IAMBinding( | |
| new gcp.projects.IAMBinding( |
| } | ||
| ); | ||
|
|
||
| const sev4OrLessRoute = new grafana.oncall.Route( |
Copilot
AI
Nov 20, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unused variable sev4OrLessRoute.
| // 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( |
Copilot
AI
Nov 20, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unused variable sev4RouteSentry.
| const sev4RouteSentry = new grafana.oncall.Route( | |
| new grafana.oncall.Route( |
| ); | ||
|
|
||
| // Create routes for the Zendesk webhook integration. | ||
| const infraSev2Route = new grafana.oncall.Route( |
Copilot
AI
Nov 20, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unused variable infraSev2Route.
| const infraSev2Route = new grafana.oncall.Route( | |
| new grafana.oncall.Route( |
| } | ||
| ); | ||
|
|
||
| const infraSev3Route = new grafana.oncall.Route( |
Copilot
AI
Nov 20, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unused variable infraSev3Route.
| } | ||
| ); | ||
|
|
||
| const infraSev4OrLessRoute = new grafana.oncall.Route( |
Copilot
AI
Nov 20, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unused variable infraSev4OrLessRoute.
| const infraSev4OrLessRoute = new grafana.oncall.Route( | |
| new grafana.oncall.Route( |
WHAT
Add threshold enforcement to keysets