Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Host: only evict HA sequencer enclaves #2222

Merged
merged 3 commits into from
Dec 20, 2024

Conversation

BedrockSquirrel
Copy link
Collaborator

Why this change is needed

Treating single-enclave nodes and backup enclaves as being critical made some things more fragile than they needed to be.

Also evicting enclaves was happening a bit too quickly, causing race conditions at startup etc.

What changes were made as part of this PR

Slow down eviction. Enclave service only evicts active sequencers (no need for single-enclave validators).

PR checks pre-merging

Please indicate below by ticking the checkbox that you have read and performed the required
PR checks

  • PR checks reviewed and performed

@badgersrus badgersrus self-requested a review December 20, 2024 16:56
@@ -275,9 +275,8 @@ func (g *Guardian) mainLoop() {
g.logger.Trace("mainLoop - enclave status", "status", g.state.GetStatus())
switch g.state.GetStatus() {
case Disconnected, Unavailable:
if unavailableCounter > 3 {
if unavailableCounter > 10 {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we might want to stick this in the host config in the event enclaves are getting stuck for a while (networking issues or something). when we're on K8s will be really easy to tweak

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah agree but still a bit finger in the air on all this stuff (like it might end up being that we want to evict based on a timeout or just on failed batch submission). I'll add a todo to be configurable once we're happy with the trigger.

e.logger.Info("not running in HA mode, no need to evict enclave", log.EnclaveIDKey, enclaveID)
return
}
if *e.activeSequencerID != *enclaveID {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

any reason we can't compare the actual values here instead?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this does compare the values (although I haven't fully internalised the quirks around this tbh lol). I had it as e.activeSequencerID == enclaveID below and Tudor fixed it, think it was comparing the pointers with that.

Copy link
Contributor

@badgersrus badgersrus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

couple of comments, feel free to ignore and lgtm!

@BedrockSquirrel BedrockSquirrel merged commit 04a765a into main Dec 20, 2024
2 checks passed
@BedrockSquirrel BedrockSquirrel deleted the matt/only-evict-active-ha-seq branch December 20, 2024 18:24
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.

2 participants