Consensys / teku

Open-source Ethereum consensus client written in Java
https://consensys.io/teku
Apache License 2.0
656 stars 278 forks source link

Add automatic reset for Ephemery Network #8589

Open gconnect opened 1 week ago

gconnect commented 1 week ago

Description

Ephemery network have a reset period. As a node runner/validator, I would want my db to be automatically deleted and the update to happen automatically without manually restarting and deleting the old db.

Expected behavior: [What you expect to happen]

Actual behavior: [What actually happens]

Frequency: [How regularly does it occur?] Always

Versions (Add all that apply)

gconnect commented 1 week ago

@rolfyone please assign this issue to me and let me know what you think on possible best steps to achieve this.

rolfyone commented 6 days ago

I think the easiest will be more like what I had messaged, but to reiterate,

gconnect commented 6 days ago

I think the easiest will be more like what I had messaged, but to reiterate,

  • firstly on startup, check the fork against the fork of the database, and if it's not matching, rather than fail to start if ephemery, delete the netowrk.yaml and db folder and initialise the database fresh
  • during epoch processing or slot processing, we check the slot is less than the max, otherwise we throw IllegalStateException and let the system crash
  • Then what will happen if its wrapped in a service is it'll automatically restart, and that'll run our startup logic to clean the database... i'd see points 1 and 2 as their own PRs for sanity...

Thanks for this. I will look into it.