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

remove the need of ecdsa key by default #120

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 4 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
19 changes: 13 additions & 6 deletions holesky/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,14 @@ NODE_CHURNER_URL=churner-holesky.eigenda.xyz:443
# If set to empty string, the IP address will be taken from the connection.
# The rightmost value of the header will be used.
NODE_CLIENT_IP_HEADER=x-real-ip
# How often to check the public IP address of the node. Set this to 0 to disable
# automatic IP address updating (if you have a stable IP address)
NODE_PUBLIC_IP_CHECK_INTERVAL=10s

# How often to check the public IP address of the node.
# This is disabled by default since this requires operator's
# ecdsa key which we don't recommend giving access to the node
# If for some reason you want this feature, you can use values like 5m, 10m, 1h etc.
# If you enable it, makes sure your node have access to the ecdsa key
# Follow this guidance to enable this feature: TODO(madhur): Add the link to the guidance
NODE_PUBLIC_IP_CHECK_INTERVAL=0

###############################################################################
####### TODO: Operators please update below values for your node ##############
Expand All @@ -89,13 +94,15 @@ NODE_DB_PATH_HOST=${EIGENDA_HOME}/db
NODE_CACHE_PATH_HOST=${USER_HOME}/eigenda-operator-setup/resources/cache

# TODO: Operators need to update this to their own keys
NODE_ECDSA_KEY_FILE_HOST=${EIGENLAYER_HOME}/operator_keys/opr.ecdsa.key.json
# Uncomment NODE_ECDSA_KEY_FILE_HOST if your node need access to ecdsa key. This is generally not recommended
# NODE_ECDSA_KEY_FILE_HOST=${EIGENLAYER_HOME}/operator_keys/opr.ecdsa.key.json
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we still generate this key in EigenLayer cli by default?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

by default we don't generate any key - they can generate or not but - it's not them.

NODE_BLS_KEY_FILE_HOST=${EIGENLAYER_HOME}/operator_keys/opr.bls.key.json

# TODO: The ip provider service used to obtain a node's public IP [seeip (default), ipify)
NODE_PUBLIC_IP_PROVIDER=seeip

# TODO: Operators need to add password to decrypt the above keys
# If you have some special characters in password, make sure to use single quotes
NODE_ECDSA_KEY_PASSWORD=''
NODE_BLS_KEY_PASSWORD=''
# Uncomment NODE_ECDSA_KEY_PASSWORD if your node need access to ecdsa key. This is generally not recommended
# NODE_ECDSA_KEY_PASSWORD=''
NODE_BLS_KEY_PASSWORD=''
3 changes: 2 additions & 1 deletion holesky/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ services:
networks:
- eigenda
volumes:
- "${NODE_ECDSA_KEY_FILE_HOST}:/app/operator_keys/ecdsa_key.json:readonly"
# Uncomment the following line if you want Node to use ecdsa key. This is generally not recommended
# - "${NODE_ECDSA_KEY_FILE_HOST}:/app/operator_keys/ecdsa_key.json:readonly"
- "${NODE_BLS_KEY_FILE_HOST}:/app/operator_keys/bls_key.json:readonly"
- "${NODE_G1_PATH_HOST}:/app/g1.point:readonly"
- "${NODE_G2_PATH_HOST}:/app/g2.point.powerOf2:readonly"
Expand Down
99 changes: 81 additions & 18 deletions holesky/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,77 @@

. ./.env

# Initialize variables
NODE_ECDSA_KEY_FILE_HOST=""
NODE_ECDSA_KEY_PASSWORD=""
OPERATION_TYPE=""
QUORUMS=""

# Function to display usage information
show_help() {
echo "Usage: $0 [options]"
echo "Options:"
echo " -h, --help Display this help message"
echo " --node-ecdsa-key-file-host <path> Path to the node's ECDSA key file. Required for opt-in, opt-out and update-socket operations"
echo " --node-ecdsa-key-password <password> Password for the node's ECDSA key file. Required for opt-in, opt-out and update-socket operations"
echo " --operation-type <operation> Operation type (opt-in, opt-out, list-quorums, update-socket)"
echo " --quorums <quorums> Quorum IDs to opt-in or opt-out"
}

# Loop through command-line arguments
while [ $# -gt 0 ]; do
key="$1"

case $key in
-h|--help)
show_help
exit 0
;;
--node-ecdsa-key-file-host)
NODE_ECDSA_KEY_FILE_HOST="$2"
shift
;;
--node-ecdsa-key-password)
NODE_ECDSA_KEY_PASSWORD="$2"
shift
;;
--operation-type)
OPERATION_TYPE="$2"
shift
;;
--quorums)
QUORUMS="$2"
shift
;;
*) # Unknown flag
echo "Unknown option: $1"
exit 1
;;
esac
shift
done

# Check if flags are provided
shrimalmadhur marked this conversation as resolved.
Show resolved Hide resolved
if [ -z "$OPERATION_TYPE" ]; then
echo "--operation-type is required."
exit 1
fi

if [ "$OPERATION_TYPE" != "list-quorums" ] && [ -z "$NODE_ECDSA_KEY_FILE_HOST" ]; then
echo "--node-ecdsa-key-file-host is required."
exit 1
fi

if [ "$OPERATION_TYPE" != "list-quorums" ] && [ -z "$NODE_ECDSA_KEY_PASSWORD" ]; then
echo "--node-ecdsa-key-password is required."
exit 1
fi

if { [ "$OPERATION_TYPE" = "opt-in" ] || [ "$OPERATION_TYPE" = "opt-out" ]; } && [ -z "$QUORUMS" ] ; then
echo "--quorum is required for opt-in or opt-out operation."
exit 1
fi

socket="$NODE_HOSTNAME":"${NODE_DISPERSAL_PORT}"\;"${NODE_RETRIEVAL_PORT}"

node_plugin_image="ghcr.io/layr-labs/eigenda/opr-nodeplugin:release-0.6.2"
Expand Down Expand Up @@ -45,11 +116,9 @@ listQuorums() {
# we have to pass a dummy quorum-id-list as it is required by the plugin
docker run --env-file .env \
--rm \
--volume "${NODE_ECDSA_KEY_FILE_HOST}":/app/operator_keys/ecdsa_key.json \
shrimalmadhur marked this conversation as resolved.
Show resolved Hide resolved
--volume "${NODE_BLS_KEY_FILE_HOST}":/app/operator_keys/bls_key.json \
--volume "${NODE_LOG_PATH_HOST}":/app/logs:rw \
"$node_plugin_image" \
--ecdsa-key-password "$NODE_ECDSA_KEY_PASSWORD" \
--bls-key-password "$NODE_BLS_KEY_PASSWORD" \
--socket "$socket" \
--operation list-quorums \
Expand All @@ -71,23 +140,17 @@ updateSocket() {
--quorum-id-list 0
}

if [ "$1" = "opt-in" ]; then
if [ -z "$2" ]; then
echo "Please provide quorum number (0/1/0,1)"
echo "Example Usage: ./run.sh opt-in 0"
exit 1
fi
optIn "$2"
elif [ "$1" = "opt-out" ]; then
if [ -z "$2" ]; then
echo "Please provide quorum number (0/1/0,1)"
echo "Example Usage: ./run.sh opt-out 0"
exit 1
fi
optOut "$2"
elif [ "$1" = "list-quorums" ]; then
if [ "$OPERATION_TYPE" = "opt-in" ]; then
echo "Opting in"
optIn "$QUORUMS"
elif [ "$OPERATION_TYPE" = "opt-out" ]; then
echo "Opting out"
optOut "$QUORUMS"
elif [ "$OPERATION_TYPE" = "list-quorums" ]; then
echo "Listing quorums"
listQuorums
elif [ "$1" = "update-socket" ]; then
elif [ "$OPERATION_TYPE" = "update-socket" ]; then
echo "Updating socket"
updateSocket
else
echo "Invalid command"
Expand Down