Merge remote-tracking branch 'origin/release-v7.0.0' into unstable

This commit is contained in:
Michael Sproul
2025-03-29 13:01:58 +11:00
21 changed files with 364 additions and 48 deletions

View File

@@ -5750,6 +5750,27 @@ impl ApiTester {
self
}
pub async fn test_post_lighthouse_add_remove_peer(self) -> Self {
let trusted_peers = self.ctx.network_globals.as_ref().unwrap().trusted_peers();
// Check that there aren't any trusted peers on startup
assert!(trusted_peers.is_empty());
let enr = AdminPeer {enr: "enr:-QESuEDpVVjo8dmDuneRhLnXdIGY3e9NQiaG4sJR3GS-VMQCQDsmBYoQhJRaPeZzPlTsZj2F8v-iV4lKJEYIRIyztqexHodhdHRuZXRziAwAAAAAAAAAhmNsaWVudNiKTGlnaHRob3VzZYw3LjAuMC1iZXRhLjSEZXRoMpDS8Zl_YAAJEAAIAAAAAAAAgmlkgnY0gmlwhIe11XmDaXA2kCoBBPkAOitZAAAAAAAAAAKEcXVpY4IjKYVxdWljNoIjg4lzZWNwMjU2azGhA43ihEr9BUVVnIHIfFqBR3Izs4YRHHPsTqIbUgEb3Hc8iHN5bmNuZXRzD4N0Y3CCIyiEdGNwNoIjgoN1ZHCCIyiEdWRwNoIjgg".to_string()};
self.client
.post_lighthouse_add_peer(enr.clone())
.await
.unwrap();
let trusted_peers = self.ctx.network_globals.as_ref().unwrap().trusted_peers();
// Should have 1 trusted peer
assert_eq!(trusted_peers.len(), 1);
self.client.post_lighthouse_remove_peer(enr).await.unwrap();
let trusted_peers = self.ctx.network_globals.as_ref().unwrap().trusted_peers();
// Should be empty after removing
assert!(trusted_peers.is_empty());
self
}
pub async fn test_post_lighthouse_liveness(self) -> Self {
let epoch = self.chain.epoch().unwrap();
let head_state = self.chain.head_beacon_state_cloned();
@@ -7314,6 +7335,8 @@ async fn lighthouse_endpoints() {
.test_post_lighthouse_database_reconstruct()
.await
.test_post_lighthouse_liveness()
.await
.test_post_lighthouse_add_remove_peer()
.await;
}