Skip to content

Conversation

@pinebit
Copy link
Contributor

@pinebit pinebit commented Dec 17, 2025

Added script that updates anti-slashing DB json file (https://eips.ethereum.org/EIPS/eip-3076#json-schema) by looking into the source and target cluster-lock.json files produced after an edit command.

Sample output:

$ ./scripts/update-anti-slashing-db.sh asdb.json src-charon/cluster-lock.json dst-charon/cluster-lock.json
Reading EIP-3076 file: asdb.json
Source cluster-lock: src-charon/cluster-lock.json
Target cluster-lock: dst-charon/cluster-lock.json

Source cluster-lock has 5 validators
Target cluster-lock has 5 validators

Processing pubkey: 0xb78a2b3be394092171778d25c8de1d7a62517930a8651feae045e817fc024e3ab5fee7acf1fd0d908bf0a71a6dbfacaf
  Found at distributed_validators[2].public_shares[3]
  Replacing with: 0xa402e15da816008ac3832af5c09dcf7c70807e1de39a612f5f75b121ff65b70fae86d1deb2ee486034c26e74381bbb3c
  Done

Successfully updated asdb.json

Copy link

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 a new bash script to update an EIP-3076 anti-slashing database JSON file by mapping public keys from a source cluster-lock.json to a target cluster-lock.json. The script is designed to support the workflow where validators are edited via an edit command, producing new cluster-lock files with updated validator configurations.

Key changes:

  • Implements pubkey lookup and replacement logic using jq for JSON manipulation
  • Validates cluster-lock structure and ensures target has sufficient validators/shares
  • Provides comprehensive error handling and validation throughout the update process

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

Copy link

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

Copilot reviewed 1 out of 1 changed files in this pull request and generated 6 comments.


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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants