Skip to content

Commit

Permalink
Add ethdo attester inclusion feature
Browse files Browse the repository at this point in the history
  • Loading branch information
coincashew committed Jul 4, 2024
1 parent cc0b10b commit 4456b95
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 9 deletions.
26 changes: 17 additions & 9 deletions ethpillar.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# 🙌 Ask questions on Discord:
# * https://discord.gg/dEpAVWgFNB

VERSION="1.7.3"
VERSION="1.7.5"
BASE_DIR=$HOME/git/ethpillar

# Load functions
Expand Down Expand Up @@ -248,12 +248,13 @@ while true; do
6 "Generate / Import Validator Keys"
7 "View validator pubkeys and indices"
- ""
8 "Generate Voluntary Exit Messages (VEM) with ethdo"
9 "Broadcast Voluntary Exit Messages (VEM) with ethdo"
10 "Check validator status, balance with ethdo"
8 "Generate Voluntary Exit Messages (VEM)"
9 "Broadcast Voluntary Exit Messages (VEM)"
10 "Check validator status, balance"
11 "Check validator entry/exit queue with beaconcha.in"
12 "Attestation Performance: Obtain information about attester inclusion"
- ""
12 "Back to main menu"
13 "Back to main menu"
)

# Display the submenu and get the user's choice
Expand Down Expand Up @@ -308,11 +309,14 @@ while true; do
installEthdo
checkValidatorStatus
;;

11)
checkValidatorQueue
;;
12)
installEthdo
checkValidatorAttestationInclusion
;;
13)
break
;;
esac
Expand Down Expand Up @@ -633,8 +637,9 @@ while true; do
5 "Next duties: Show expected time between block proposals, sync comm"
6 "Sweep delay: Show time until next withdrawal"
7 "Credentials: Show withdrawal address"
8 "Update to latest release"
9 "Uninstall ethdo"
8 "Attestation Performance: Obtain information about attester inclusion"
9 "Update to latest release"
10 "Uninstall ethdo"
- ""
99 "Back to main menu"
)
Expand Down Expand Up @@ -676,9 +681,12 @@ while true; do
ethdoWithdrawalAddress
;;
8)
runScript ethdo.sh -u
checkValidatorAttestationInclusion
;;
9)
runScript ethdo.sh -u
;;
10)
runScript ethdo.sh -r
;;
99)
Expand Down
26 changes: 26 additions & 0 deletions functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -592,6 +592,32 @@ checkValidatorStatus(){
done
}

# Takes a validator index # or pubkey and checks attestation inclusion
checkValidatorAttestationInclusion(){
local _INDEX=""
clear
echo "#############################################################################"
ohai "Attestation Performance: Obtain information about attester inclusion"
echo "#############################################################################"
ohai "Key Points:"
echo "* Timely: Validators are called to attest (or vote) only once every epoch."
echo "* Correctness: When attesting, validators vote on their version of the perceived state of the chain, namely the source, head and target."
echo "* Inclusion delay: Ideally, 1. The number of slots separating the block proposal and attestation."
# Get validator index from user
while true; do
read -r -p "${tty_blue}Enter your Validator's Index or public key: (Press enter for example)${tty_reset} " _INDEX
_INDEX=${_INDEX:-1337}
read -r -p "${tty_blue}Enter epoch: (Press enter for last epoch)${tty_reset} " _EPOCH
_EPOCH=${_EPOCH:-"-1"}
ethdo --connection ${API_BN_ENDPOINT} attester inclusion --validator=${_INDEX} --epoch=${_EPOCH} --verbose
read -r -p "${tty_blue}Check another validator or epoch? (y/n) ${tty_reset}" yn
case ${yn} in
[Nn]*) break ;;
*) continue ;;
esac
done
}

# Install ethdo if not yet installed
installEthdo(){
if [[ ! -f /usr/local/bin/ethdo ]]; then
Expand Down

0 comments on commit 4456b95

Please sign in to comment.