> For the complete documentation index, see [llms.txt](https://docs.eclipse.xyz/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.eclipse.xyz/architecture/eclipse-architecture/eclipse-l1-gateway/purpose-and-high-level-flow.md).

# Purpose and High-Level Flow

## Purpose and High-Level Flow

When the **Eclipse L2** generates a new block (or “batch”), it posts a commitment to the Gateway. This references the previous commit to maintain continuity. The Gateway enforces the correct parent-child relationship and logs each commit to an internal registry to prevent duplicates.

* **Initialization**: The contract starts uninitialized. The first `submitBatch` with a zero parent hash becomes the **genesis batch**.
* **Normal Operation**: As the aggregator or sequencer produces new L2 blocks, they call `submitBatch`, extending the chain tip.
* **Forking**: If a dispute or bug arises, an authorized user (an entity with `FORKER_ROLE`) can create a new fork from a specific commit (by calling `forkChain`) , potentially replacing the current chain.
* **Canonicality**: By default, the chain with the highest fork ID is considered the tip. However, older forks remain in storage (and can be restored if needed).
* **Access Control**: OpenZeppelin’s `AccessControlEnumerable` checks every critical function (e.g., only `PAUSER_ROLE` can pause).
* **Pausible**: While paused, no commits or forks can happen, protecting the contract from malicious or unintended updates.

Below, we dive into each concept, show test code to illustrate usage, and then present the **detailed sequence diagrams** and **state transition diagrams** that map out the system’s execution in a visual format.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.eclipse.xyz/architecture/eclipse-architecture/eclipse-l1-gateway/purpose-and-high-level-flow.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
