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

Duplicate consensus msgs upon sequencer reboot #1175

Open
omritoptix opened this issue Oct 28, 2024 · 1 comment · May be fixed by #1222
Open

Duplicate consensus msgs upon sequencer reboot #1175

omritoptix opened this issue Oct 28, 2024 · 1 comment · May be fixed by #1222
Assignees

Comments

@omritoptix
Copy link
Contributor

once sequence reboots, we will generate duplicate consensus msgs as we don't persist the last state of the sequencer we saw in state. in case the sequencer is in a restart loop this can nasty.

@keruch
Copy link
Contributor

keruch commented Nov 11, 2024

It is impossible (or at least hardly feasible) to persist the sequencer set in both full node and proposer modes because we need to persist not the latest sequencer set but the one we had while applying the latest block. And in full node mode we cannot get this unless the proposer persists this info into the block. Finally, I came up with storing two versions of the sequencer set:

  1. The latest set that we get from polling: Store it in memory and use it for both modes.
  2. The last block sequencer set: the one we used while producing the last block. Store it in the store while producing blocks in the proposer mode.

Now the proposer will create consensus messages during block production based on the difference between these two sets.

On reboots:

  1. The proposer gets the last set from the Hub.
  2. While producing the block, get the last block set from the store.
  3. Memorize the current set (from memory == from Hub).
  4. Compute diff and create consensus messages.
  5. If the block production is successful, save the memorized set from (3) as the last block set (and use it on the next production).

The only drawback is that the full node does not persist in the sequencer set, so on rotation it will duplicate consensus messages, but only once.

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 a pull request may close this issue.

2 participants