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

Escape Hatch #243

Merged
merged 14 commits into from
Oct 11, 2024
Merged

Escape Hatch #243

merged 14 commits into from
Oct 11, 2024

Conversation

zacshowa
Copy link
Member

@zacshowa zacshowa commented Oct 8, 2024

Closes #221

This PR:

Adds a check in the sequencer that takes the l1 block height for transactions that are about to be sequencedand determines if hotshot is live based on that height. If hot shot is live we designate these transactions as espresso messages and attempt to sequence them with the sovereign sequencer. otherwise we designate them as normal Arbitrum messages and sequence them based on normal Arbitrum behavior.

In the future the shouldSequenceWithEspresso will also be gated by the chainConfig.EnableEspresso flag to enable correct migration.

This PR may break the espresso finality node test as we have no clear way to disable the sovereign sequencer until we add the chain config checks. I will fix this in the PR related to adding chain config checks.

This PR does not:

Add any checks related to the chain config.

Key places to review:

sequencer.go in execution/gethexec and the E2E test for correctness.

Run the E2E test with go test -run ^TestEspressoE2E$ github.com/offchainlabs/nitro/system_tests -v

The E2E test passes locally.

// The following call will be used to check the liveness based on the l1 block height.
// isHotShotLive := wavmio.IsHotShotLive(message.Message.Header.BlockNumber)
//
// The following line should be changed to if validatingAgainstEspresso && isHotShotLive {

Choose a reason for hiding this comment

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

As discussed, we dont need this because we will not be creating espresso transactions if the escape hatch is enabled

Copy link
Member Author

Choose a reason for hiding this comment

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

I can remove this comment then!

err error
)

if l1Reader != nil {
Copy link

@Sneh1999 Sneh1999 Oct 10, 2024

Choose a reason for hiding this comment

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

we should add a comment here describing why we are creating a light client reader for other readers

Copy link
Member Author

Choose a reason for hiding this comment

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

Agreed 👍

// Initialize shouldSequenceWithEspresso to false and if we have a light client reader then give it a value based on hotshot liveness
// This is a side effect of the sequencer having the capability to run without an L1 reader. For the Espresso integration this is a necessary component of the sequencer.
// However, many tests use the case of having a nil l1 reader
if s.lightClientReader != nil {

Choose a reason for hiding this comment

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

I am thinking this might cause some issues - so lets say I have espresso enabled but I run the sequencer without the lightClientReader , I will never create espresso transactions then. It could just be a honest configuration issue but I might not realize it. Let me know your thoughts on the same!

Copy link
Member Author

Choose a reason for hiding this comment

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

You're right that this would be an issue if someone were to attempt to set up a sequencer node without enabling the parent chain reader, but in that case it should act as a normal nitro sequencer.

I think it's a fine bound to add to our sequencer that we need an l1 reader for it to function in espresso mode properly. Fundamentally we need to read from the light client to decide how to sequence with the escape hatch. Doing it this way allows normal nitro sequencers with this code base, but also adds compatibility with espresso. I think its fine to expect node operators to configure their sequencer appropriately when they want to use espresso.

Choose a reason for hiding this comment

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

As discussed, it might be best to just use the sovereign sequencer flag and if it is turned on, return an error if a sequencer's lightClientReader is nil

Copy link

@Sneh1999 Sneh1999 left a comment

Choose a reason for hiding this comment

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

LGTM!

@zacshowa zacshowa merged commit 824b971 into integration Oct 11, 2024
9 checks passed
@zacshowa zacshowa deleted the escape-hatch-simple branch October 11, 2024 20:03
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.

Sovereign Sequencer: Escape Hatch
3 participants