Skip to content

Inspection script for network operators#44

Merged
dimpar merged 4 commits intomasterfrom
inspection
Sep 18, 2020
Merged

Inspection script for network operators#44
dimpar merged 4 commits intomasterfrom
inspection

Conversation

@pdyraga
Copy link
Copy Markdown
Member

@pdyraga pdyraga commented Sep 17, 2020

Based on the list of nodes working in the network, the script inspects the status of beacon and ECDSA operators: their address, eligible stake, ETH operator account balance, and unbonded value (only for ECDSA operators).

Instructions:

  1. Please fetch the node list from /diagnostics endpoint of a node, preferably a bootstrap node. Save ECDSA node list in input-data/ecdsa-nodes.json and beacon node list in input-data/beacon-nodes.json.
  2. Run npm install.
  3. Execute ETH_HOSTNAME="<your_eth_host>" truffle exec ./scripts/inspect-operators.js --network mainnet.
  4. To output data in text-only mode, please set OUTPUT_MODE environment variable to "text".

Based on the list of nodes working in the network, script inspects the
status of beacon and ECDSA operators: their address, eligible stake, ETH
operator account balance and unbonded value (only for ECDSA operators).
@pdyraga
Copy link
Copy Markdown
Member Author

pdyraga commented Sep 17, 2020

Example, generated today for Ropsten:


*** Contract Addresses ***
KeepToken:                0x343d3DDA00415289CDD4E8030F63a4A5a2548ff9
TokenStaking:             0x234d2182B29c6a64ce3ab6940037b5C8FdAB608e
KeepRandomBeaconOperator: 0xC8337a94a50d16191513dEF4D1e61A6886BF410f
BondedECDSAKeepFactory:   0x9EcCf03dFBDa6A5E50d7aBA14e0c60c2F6c575E6
KeepBonding:              0x60535A59B4e71F908f3fEB0116F450703FB35eD8

Fetching staking info for [351] beacon operators...

*** Beacon Operators ***
┌─────────┬──────────────────────────────────────────────┬───────────────────┬───────────────────────────┐
│ (index) │                   address                    │ eligibleStakeKeep │    operatorBalanceEth     │
├─────────┼──────────────────────────────────────────────┼───────────────────┼───────────────────────────┤
│    0    │ '0xcf5006c786be15c4E19a3A747472958319e0f236' │     '300000'      │    '0.99762168423065'     │
│    1    │ '0xB8E38C04Be2a1d7B957aFE6A67D4A29ffD0d7F6F' │     '300000'      │  '4.890354642490376064'   │
│    2    │ '0x66dEcd24b3464B6bfce952E8cf5aA2181E37E841' │     '300000'      │  '0.720443407751171434'   │
│    3    │ '0xae050fb0A73C9B58D0EC95906E39CcCA2b7b9D13' │     '300000'      │  '1.855901461617326316'   │
(...)
│   347   │ '0x7eDe6998Ab6B0762F7f619487498de2839cAb16d' │     '300000'      │  '0.105201963802978328'   │
│   348   │ '0x06422eCB75F090446e09581eaB994ca325DBDBEa' │     '299100'      │  '0.405048103091202169'   │
│   349   │ '0x550EEbbFc9dd6713d0eC767CE925339EDACC9Ab8' │     '298200'      │    '12.99428769679309'    │
│   350   │ '0x1332f3755F48A9C7f618681ae3BDBE618Ddf65D9' │     '299100'      │  '0.496017127657314991'   │
└─────────┴──────────────────────────────────────────────┴───────────────────┴───────────────────────────┘

Fetching staking info for [364] ECDSA operators...

*** ECDSA Operators ***
┌─────────┬──────────────────────────────────────────────┬───────────────────┬───────────────────────────┬─────────────────────┐
│ (index) │                   address                    │ eligibleStakeKeep │    operatorBalanceEth     │  unbondedValueEth   │
├─────────┼──────────────────────────────────────────────┼───────────────────┼───────────────────────────┼─────────────────────┤
│    0    │ '0xf5baAFd40ACcd666767c5981dBB09DA0045F2Cfe' │    '11981100'     │  '10.621362357960787337'  │   '5.5333333334'    │
│    1    │ '0xf20d7B2357bAb32F3aAFF59aC0c85a3BFc18Dd98' │        '0'        │  '60.998721355854389667'  │        '50'         │
│    2    │ '0x5031821e261052861701220c643c245287B8C02f' │     '299100'      │  '0.070751600631093441'   │         '1'         │
│    3    │ '0xb648463632E96930376F32769EE479770919a4Ea' │     '299100'      │  '4.244828028058967232'   │         '2'         │
│    4    │ '0x9b7126BC3Ab1A2343BF9ea4d09fB9C290955826c' │     '300000'      │  '16.186356770867214084'  │        '30'         │
│    5    │ '0x1AfBCba89b9382778d113D9b597fD10Df9d0A359' │     '300000'      │    '4.26891623229625'     │        '21'         │
│    6    │ '0x04568202AF6c40688e976CbF695764BC004b6556' │     '300000'      │  '5.979191190224102849'   │         '0'         │
│    7    │ '0x9bBA95f8f3bC4C418e71B3Bf948545ae0062a2B7' │    '11988300'     │  '4.898229152369716579'   │        '290'        │
│    8    │ '0xe0930d3C9f9dC6423E07829E62cF86e92c6C6D89' │     '299100'      │  '43.052761737820044422'  │        '20'         │
│    9    │ '0xEf9d8AF49f06b16A7E262Ce25172f656b13C7D3D' │     '300000'      │  '34.992788712273481969'  │        '35'         │
│   10    │ '0x0EDFBdc5ff06DA1cd7Da74756Fb6512D04733080' │     '300000'      │  '0.978600795351544332'   │        '27'         │
│   11    │ '0x7295dBD0449aCa361640C4084c3fDB0f30B720d8' │    '11979300'     │  '2.421209646564869087'   │        '20'         │
(...)
│   361   │ '0xcAa36fFbBAab6aD28913435e0c549ff5B5F2add2' │     '300000'      │  '5.997459518250205574'   │        '21'         │
│   362   │ '0xf6ca6469106c1b4fCd5E691D5F4a5ddE6d3bC8B8' │     '300000'      │    '0.98907306634422'     │        '28'         │
│   363   │ '0x3172ccf68dF768099fbAD361B1A5402dCF253282' │     '299100'      │       '9.890398348'       │        '0.1'        │
└─────────┴──────────────────────────────────────────────┴───────────────────┴───────────────────────────┴─────────────────────┘

@Shadowfiend
Copy link
Copy Markdown
Contributor

May want to consider a mode where this stuff is spit out (a) without quotation marks and (b) tab-delimited with no additional decoration or headers. Mostly because you can then pipe to sort -k and cut -f to sort by and extract specific fields.

When OUTPUT_MODE environment variable is set to 'text', the information
is printed with tab-delimited columns and no quotation marks.
@pdyraga
Copy link
Copy Markdown
Member Author

pdyraga commented Sep 18, 2020

May want to consider a mode where this stuff is spit out (a) without quotation marks and (b) tab-delimited with no additional decoration or headers. Mostly because you can then pipe to sort -k and cut -f to sort by and extract specific fields.

Good point! Added in a12eb1d. It's enough to set OUTPUT_MODE environment variable to "text".

@pdyraga pdyraga marked this pull request as ready for review September 18, 2020 11:24
@dimpar
Copy link
Copy Markdown
Contributor

dimpar commented Sep 18, 2020

LGTM!

@dimpar dimpar merged commit 25190c8 into master Sep 18, 2020
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.

3 participants