TobiWo/eth-duties

Refactor code to get healthy beacon node connection

Opened this issue · 0 comments

Summary

The current implementation is suboptimal as the beacon node healthiness is checked on each and every API call (running synchronously with the main process ). This is unnecessary extra load for eth-duties and for the beacon node. It would be better to asynchronously run a process which checks beacon node healthiness every x seconds/minutes/hours and stores the result in a List which can be accessed from the request module.

Brainstorming

  • write async function in 'BeaconNode` class which fetches healthiness of beacon nodes
  • write async function which executes the healthiness function based on an interval
  • add async function to main task group which means it will run independently of all other tasks
  • on failure during api call the healthiness function can be triggered again (maybe)
  • also optimize logging for beacon node failures etc. -> especially how often the different logs are printed -> this is currently a mess since it is running synchronously

Extension

Improve not only for beacon node but also validator node connections.