ethereum-optimism / optimism

Optimism is Ethereum, scaled.
https://optimism.io
MIT License
5.58k stars 3.22k forks source link

op-node: sequencer does not check op-conductor on node startup #11121

Open protolambda opened 2 months ago

protolambda commented 2 months ago

When the sequencer is first initialized, it takes the sequencing enabled & active status from the regular op-node config and state-persistence, but doesn't additionally check the leader-status with the conductor like it does upon sequencer start/stop. Is this intentional? Should we make it check with the conductor, before allowing the sequencer to continue?

As part of the events-refactor of the sequencer code-path I noticed this, and I am wondering if it should change or not. See #10991

zhwrd commented 2 months ago

we have a config check to ensure config persistence is disabled when conductor is enabled https://github.com/ethereum-optimism/optimism/blob/develop/op-node/node/config.go#L166-L173

0x00101010 commented 2 weeks ago

Great observation! This situation could happen, when starting sequencer, leadership transfer could happen and conductor could become a non-leader.

However, we don't need to do the check here because

  1. there isn't really a way to guarantee that leadership does not transfer between the time we call startSequencer and it is actually started
  2. and if the leadership transfer happened during that time, it is fine as sequencer won't be able to gossip its block out, and will shortly be turned off by a functioning conductor