Remove Execution Client Fallback and Make Providing an Execution Client Required (#10921)

* Starting

* Done

* Fix more tests

* Fix test

* Fix test

* fix up

* building

* requirement

* gaz

* builds

* rem deadcode

* fix

* fix up

* removed checked method

* Update service_test.go

Co-authored-by: Raul Jordan <raul@prysmaticlabs.com>
Co-authored-by: Nishant Das <nishdas93@gmail.com>
This commit is contained in:
terencechain
2022-08-16 10:22:34 -07:00
committed by GitHub
parent e0eee87bf4
commit 2728b83f6a
27 changed files with 127 additions and 431 deletions

View File

@@ -236,28 +236,6 @@ func populateBeaconNodeStats(pf metricMap) BeaconNodeStats {
}
}
f, err = pf.getFamily("powchain_sync_eth1_fallback_configured")
if err != nil {
log.WithError(err).Debug("Failed to get powchain_sync_eth1_fallback_configured")
} else {
m = f.Metric[0]
bs.SyncEth1FallbackConfigured = false
if int64(m.Gauge.GetValue()) == 1 {
bs.SyncEth1FallbackConfigured = true
}
}
f, err = pf.getFamily("powchain_sync_eth1_fallback_connected")
if err != nil {
log.WithError(err).Debug("Failed to get powchain_sync_eth1_fallback_connected")
} else {
m = f.Metric[0]
bs.SyncEth1FallbackConnected = false
if int64(m.Gauge.GetValue()) == 1 {
bs.SyncEth1FallbackConnected = true
}
}
return bs
}

View File

@@ -55,8 +55,6 @@ func TestBeaconNodeScraper(t *testing.T) {
require.Equal(t, int64(7365341184), bs.DiskBeaconchainBytesTotal)
require.Equal(t, int64(37), bs.NetworkPeersConnected)
require.Equal(t, true, bs.SyncEth1Connected)
require.Equal(t, true, bs.SyncEth1FallbackConfigured)
require.Equal(t, true, bs.SyncEth1FallbackConnected)
}
// helper function to wrap up all the scrape logic so tests can focus on data cases and assertions
@@ -85,21 +83,7 @@ func TestInvertEth1Metrics(t *testing.T) {
key: "SyncEth1Connected",
body: strings.Replace(prometheusTestBody, "powchain_sync_eth1_connected 1", "powchain_sync_eth1_connected 0", 1),
test: func(bs *BeaconNodeStats) bool {
return bs.SyncEth1Connected == false && bs.SyncEth1FallbackConfigured == true && bs.SyncEth1FallbackConnected == true
},
},
{
key: "SyncEth1FallbackConfigured",
body: strings.Replace(prometheusTestBody, "powchain_sync_eth1_fallback_configured 1", "powchain_sync_eth1_fallback_configured 0", 1),
test: func(bs *BeaconNodeStats) bool {
return bs.SyncEth1Connected == true && bs.SyncEth1FallbackConfigured == false && bs.SyncEth1FallbackConnected == true
},
},
{
key: "SyncEth1FallbackConnected",
body: strings.Replace(prometheusTestBody, "powchain_sync_eth1_fallback_connected 1", "powchain_sync_eth1_fallback_connected 0", 1),
test: func(bs *BeaconNodeStats) bool {
return bs.SyncEth1Connected == true && bs.SyncEth1FallbackConfigured == true && bs.SyncEth1FallbackConnected == false
return bs.SyncEth1Connected == false
},
},
}

View File

@@ -49,12 +49,10 @@ type CommonStats struct {
// to be present with their zero-value when not supported by a client.
type BeaconNodeStats struct {
// TODO(#8850): add support for this after slasher refactor is merged
SlasherActive bool `json:"slasher_active"`
SyncEth1FallbackConfigured bool `json:"sync_eth1_fallback_configured"`
SyncEth1FallbackConnected bool `json:"sync_eth1_fallback_connected"`
SyncEth1Connected bool `json:"sync_eth1_connected"`
SyncEth2Synced bool `json:"sync_eth2_synced"`
DiskBeaconchainBytesTotal int64 `json:"disk_beaconchain_bytes_total"`
SlasherActive bool `json:"slasher_active"`
SyncEth1Connected bool `json:"sync_eth1_connected"`
SyncEth2Synced bool `json:"sync_eth2_synced"`
DiskBeaconchainBytesTotal int64 `json:"disk_beaconchain_bytes_total"`
// N/A -- would require significant network code changes at this time
NetworkLibp2pBytesTotalReceive int64 `json:"network_libp2p_bytes_total_receive"`
// N/A -- would require significant network code changes at this time