Skip to content

Conversation

Deniallugo
Copy link
Contributor

@Deniallugo Deniallugo commented Feb 27, 2025

What ❔

Support migration to Gateway. That will be done through restart.

There are few major changes in server

  1. Contracats config now splitted to 3 configs:
    a. L1SpecificConfig - Stuff that exists only on l1 and will never be migrated to gateway
    b. L2Contracts - Contracts that were deployed on l2
    c. ChainSpecificContracts - Contracts that deployed on l1 and on gateway
  2. L1 specific contracts and L2 contracts, for now, should be specified in contracts config, manually. In a future we will be able to load them as well
  3. ChainSpecificContracts, are loading from the Settlement Layer, no need to specify
  4. There are no configuration for settlement layer. The settlement layer known during the start of the node and the source of truth is contracts both on l1 and settlement layer.
  5. Server constantly checks that settlement layer has not changed. If it chaged, server will wait until all processed transaction are sent and confirmed and the necessary contracts are deployed to l1. After that server will be killed. We assume that kubernetes will restart the server
  6. During the start server checks the settlement layer and download the necessary contracts config, later on almost all components of the system are manipulating only with settlement layer client and config. Only eth watcher knows about both layers.

External Node:

  1. During the sync with the server External node verifies the transaction on l1 for consistency. Once consistency checker is panicking, external node crashes
  2. During the start External node checks the latest eth txs in db and depends on it setup the system to work either on Gateway or on L1

Migration process

  1. Operator call the server notifier contract and this contract will send the message to server, that all commit operations, should be stopped
  2. Server stops the commit operations, but continue to work in all other parts
  3. Operator call the migrate to gateway function on contracts
  4. Once the migration is executed both on l1 and gateway, server will crash
  5. During the next start server will load all necessary contracts and continue to work

Why ❔

The migration to settlement layer should be smooth. Without necessary of manual restarts and setting the contracts, it will drastically increase the mistakes, especially with multiple chains in operation.

Is this a breaking change?

  • Yes
  • No

Operational changes

Checklist

  • PR title corresponds to the body of PR (we generate changelog entries from PRs).
  • Tests for the changes have been added / updated.
  • Documentation comments have been added / updated.
  • Code has been formatted via zkstack dev fmt and zkstack dev lint.

Signed-off-by: Danil <deniallugo@gmail.com>
Signed-off-by: Danil <deniallugo@gmail.com>
Signed-off-by: Danil <deniallugo@gmail.com>
Signed-off-by: Danil <deniallugo@gmail.com>
Signed-off-by: Danil <deniallugo@gmail.com>
Signed-off-by: Danil <deniallugo@gmail.com>
Signed-off-by: Danil <deniallugo@gmail.com>
Signed-off-by: Danil <deniallugo@gmail.com>
Signed-off-by: Danil <deniallugo@gmail.com>
Signed-off-by: Danil <deniallugo@gmail.com>
Signed-off-by: Danil <deniallugo@gmail.com>
Signed-off-by: Danil <deniallugo@gmail.com>
Signed-off-by: Danil <deniallugo@gmail.com>
Signed-off-by: Danil <deniallugo@gmail.com>
@Deniallugo Deniallugo force-pushed the deniallugo-multilayer-client branch from bbd3f72 to a7d8222 Compare February 27, 2025 13:34
Signed-off-by: Danil <deniallugo@gmail.com>
@RomanBrodetski
Copy link
Collaborator

Please add the PR description (what/why)

@Deniallugo Deniallugo force-pushed the deniallugo-multilayer-client branch from 75b96ef to bdd72ea Compare March 4, 2025 10:54
## What ❔

Refactor contracts config and moving it to framework. Also it support
both layers Gateway and L1, allowing to automatically decide what layer
supposed to be used now.
## Why ❔

In the future the contracts config will be loaded from Settlement Layer.
It's the preparation, where no components depends on the contracts
config directly.

## Is this a breaking change?
- [ ] Yes
- [x] No

## Operational changes
<!-- Any config changes? Any new flags? Any changes to any scripts? -->
<!-- Please add anything that non-Matter Labs entities running their own
ZK Chain may need to know -->

## Checklist

<!-- Check your PR fulfills the following items. -->
<!-- For draft PRs check the boxes as you complete them. -->

- [ ] PR title corresponds to the body of PR (we generate changelog
entries from PRs).
- [ ] Tests for the changes have been added / updated.
- [ ] Documentation comments have been added / updated.
- [ ] Code has been formatted via `zkstack dev fmt` and `zkstack dev
lint`.

---------

Signed-off-by: Danil <deniallugo@gmail.com>
Signed-off-by: Danil <deniallugo@gmail.com>
Signed-off-by: Danil <deniallugo@gmail.com>
@Deniallugo Deniallugo force-pushed the deniallugo-multilayer-client branch from fe2cce5 to 08a3901 Compare March 11, 2025 19:20
Signed-off-by: Danil <deniallugo@gmail.com>
RomanBrodetski
RomanBrodetski previously approved these changes Mar 26, 2025
Copy link
Collaborator

@RomanBrodetski RomanBrodetski left a comment

Choose a reason for hiding this comment

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

Thanks for taking care of my comments. I don't have any more at the moment.

I cannot say I'm happy with the current state, as already convoluted config system became more complex, but I don't have concrete guidelines on how to improve. Perhaps we cannot do much better because of the protocol requirements.

Please wait for @slowli 's approval as well.

Copy link
Contributor

@slowli slowli left a comment

Choose a reason for hiding this comment

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

I feel I'm still nowhere close to covering the entire PR changeset, so here's partial feedback.

Signed-off-by: Danil <deniallugo@gmail.com>
Signed-off-by: Danil <deniallugo@gmail.com>
@Deniallugo Deniallugo force-pushed the deniallugo-multilayer-client branch from 106b4bf to 69b6015 Compare March 26, 2025 19:33
@Deniallugo Deniallugo requested a review from slowli March 26, 2025 20:32
Signed-off-by: Danil <deniallugo@gmail.com>
@Deniallugo Deniallugo force-pushed the deniallugo-multilayer-client branch from c0fe06c to 307a409 Compare March 26, 2025 21:42
slowli
slowli previously approved these changes Mar 27, 2025
Copy link
Contributor

@slowli slowli left a comment

Choose a reason for hiding this comment

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

Haven't found anything major, but I still feel that I haven't covered the entire changeset.

Signed-off-by: Danil <deniallugo@gmail.com>
@Deniallugo Deniallugo enabled auto-merge March 27, 2025 17:34
@Deniallugo Deniallugo added this pull request to the merge queue Mar 27, 2025
Merged via the queue into main with commit 2858ba0 Mar 27, 2025
46 checks passed
@Deniallugo Deniallugo deleted the deniallugo-multilayer-client branch March 27, 2025 18:50
github-merge-queue bot pushed a commit that referenced this pull request Apr 1, 2025
🤖 I have created a release *beep* *boop*
---


##
[20.0.0](prover-v19.0.0...prover-v20.0.0)
(2025-04-01)


### ⚠ BREAKING CHANGES

* Remove old prover stack
([#3729](#3729))
* V27 update
([#3580](#3580))

### Features

* Add S3 implementation for object_store
([#3664](#3664))
([a848927](a848927))
* **consensus:** Add consensus protocol versioning
([#3720](#3720))
([d1b4308](d1b4308))
* **gateway:** Migration to Gateway
([#3654](#3654))
([2858ba0](2858ba0))
* Remove old prover stack
([#3729](#3729))
([fbbdc76](fbbdc76))
* Use JSON-RPC for core &lt;&gt; prover interaction
([#3626](#3626))
([4e74730](4e74730))
* V27 update
([#3580](#3580))
([9e18550](9e18550))


### Bug Fixes

* API URL for prover gateway
([#3716](#3716))
([ca2c4a4](ca2c4a4))
* make proof data handler backwards compatible
([#3767](#3767))
([bdbbaaa](bdbbaaa))
* Prover job ordering
([#3738](#3738))
([8f7f831](8f7f831))
* **prover:** Fixing shutdown time for circuit-prover
([#3768](#3768))
([6c9de26](6c9de26))
* **prover:** Reevaluation of 'heavy' jobs for WVG
([#3754](#3754))
([2a8d33b](2a8d33b))
* **prover:** Remove deleted pods from autoscaler-agent cluster cache
([#3739](#3739))
([e94985f](e94985f))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

---------

Co-authored-by: zksync-era-bot <147085853+zksync-era-bot@users.noreply.github.com>
Co-authored-by: zksync-era-bot <zksync-era-bot@users.noreply.github.com>
github-merge-queue bot pushed a commit that referenced this pull request Apr 3, 2025
🤖 I have created a release *beep* *boop*
---


##
[27.2.0](core-v27.1.0...core-v27.2.0)
(2025-04-03)


### Features

* **api:** Allow EVM bytecode overrides
([#3761](#3761))
([8aee9f8](8aee9f8))
* **en:** Allow tree / state keeper cache recovery for genesis
([#3781](#3781))
([dd18c48](dd18c48))
* **eth_signer:** Support eip712 txs
([#3752](#3752))
([e278ab5](e278ab5))
* **gateway:** Handle server shutting down error
([#3777](#3777))
([8e11adc](8e11adc))
* **gateway:** Migration to Gateway
([#3654](#3654))
([2858ba0](2858ba0))
* **main:** Eigenda add custom quorum params
([#3719](#3719))
([dac58ad](dac58ad))
* Update zksync-protocol deps to 0.151.5
([#3790](#3790))
([92beffe](92beffe))
* **zkos:** remove prev index pointer from leaves
([#3771](#3771))
([5b8fd29](5b8fd29))


### Bug Fixes

* insert tokens without PG copy
([#3778](#3778))
([b7a8152](b7a8152))
* **prover:** Force set all the `prover_job` labels to 0
([#3787](#3787))
([3ecc8db](3ecc8db))
* **prover:** Reevaluation of 'heavy' jobs for WVG
([#3754](#3754))
([2a8d33b](2a8d33b))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

---------

Co-authored-by: zksync-era-bot <zksync-era-bot@users.noreply.github.com>
zkzoomer pushed a commit that referenced this pull request Jun 21, 2025
## What ❔

Support migration to Gateway. That will be done through restart. 

There are few major changes in server

1. Contracats config now splitted to 3 configs: 
a. L1SpecificConfig - Stuff that exists only on l1 and will never be
migrated to gateway
  b. L2Contracts - Contracts that were deployed on l2
c. ChainSpecificContracts - Contracts that deployed on l1 and on gateway
2. L1 specific contracts and L2 contracts, for now, should be specified
in contracts config, manually. In a future we will be able to load them
as well
3. ChainSpecificContracts, are loading from the Settlement Layer, no
need to specify
4. There are no configuration for settlement layer. The settlement layer
known during the start of the node and the source of truth is contracts
both on l1 and settlement layer.
5. Server constantly checks that settlement layer has not changed. If it
chaged, server will wait until all processed transaction are sent and
confirmed and the necessary contracts are deployed to l1. After that
server will be killed. We assume that kubernetes will restart the server
6. During the start server checks the settlement layer and download the
necessary contracts config, later on almost all components of the system
are manipulating only with settlement layer client and config. Only eth
watcher knows about both layers.


External Node:
1. During the sync with the server External node verifies the
transaction on l1 for consistency. Once consistency checker is
panicking, external node crashes
2. During the start External node checks the latest eth txs in db and
depends on it setup the system to work either on Gateway or on L1



Migration process
1. Operator call the server notifier contract and this contract will
send the message to server, that all commit operations, should be
stopped
2. Server stops the commit operations, but continue to work in all other
parts
3. Operator call the migrate to gateway function on contracts
4. Once the migration is executed both on l1 and gateway, server will
crash
5. During the next start server will load all necessary contracts and
continue to work


## Why ❔

The migration to settlement layer should be smooth. Without necessary of
manual restarts and setting the contracts, it will drastically increase
the mistakes, especially with multiple chains in operation.




## Is this a breaking change?
- [ ] Yes
- [x] No

## Operational changes
<!-- Any config changes? Any new flags? Any changes to any scripts? -->
<!-- Please add anything that non-Matter Labs entities running their own
ZK Chain may need to know -->

## Checklist

<!-- Check your PR fulfills the following items. -->
<!-- For draft PRs check the boxes as you complete them. -->

- [x] PR title corresponds to the body of PR (we generate changelog
entries from PRs).
- [x] Tests for the changes have been added / updated.
- [x] Documentation comments have been added / updated.
- [x] Code has been formatted via `zkstack dev fmt` and `zkstack dev
lint`.

---------

Signed-off-by: Danil <deniallugo@gmail.com>
zkzoomer pushed a commit that referenced this pull request Jun 21, 2025
🤖 I have created a release *beep* *boop*
---


##
[27.2.0](core-v27.1.0...core-v27.2.0)
(2025-04-03)


### Features

* **api:** Allow EVM bytecode overrides
([#3761](#3761))
([8aee9f8](8aee9f8))
* **en:** Allow tree / state keeper cache recovery for genesis
([#3781](#3781))
([dd18c48](dd18c48))
* **eth_signer:** Support eip712 txs
([#3752](#3752))
([e278ab5](e278ab5))
* **gateway:** Handle server shutting down error
([#3777](#3777))
([8e11adc](8e11adc))
* **gateway:** Migration to Gateway
([#3654](#3654))
([c861ce1](c861ce1))
* **main:** Eigenda add custom quorum params
([#3719](#3719))
([dac58ad](dac58ad))
* Update zksync-protocol deps to 0.151.5
([#3790](#3790))
([92beffe](92beffe))
* **zkos:** remove prev index pointer from leaves
([#3771](#3771))
([5b8fd29](5b8fd29))


### Bug Fixes

* insert tokens without PG copy
([#3778](#3778))
([b7a8152](b7a8152))
* **prover:** Force set all the `prover_job` labels to 0
([#3787](#3787))
([3ecc8db](3ecc8db))
* **prover:** Reevaluation of 'heavy' jobs for WVG
([#3754](#3754))
([2a8d33b](2a8d33b))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

---------

Co-authored-by: zksync-era-bot <zksync-era-bot@users.noreply.github.com>
dutterbutter pushed a commit to dutterbutter/zkstack-cli that referenced this pull request Jul 3, 2025
🤖 I have created a release *beep* *boop*
---


##
[27.2.0](matter-labs/zksync-era@core-v27.1.0...core-v27.2.0)
(2025-04-03)


### Features

* **api:** Allow EVM bytecode overrides
([#3761](matter-labs/zksync-era#3761))
([8aee9f8](matter-labs/zksync-era@8aee9f8))
* **en:** Allow tree / state keeper cache recovery for genesis
([#3781](matter-labs/zksync-era#3781))
([dd18c48](matter-labs/zksync-era@dd18c48))
* **eth_signer:** Support eip712 txs
([#3752](matter-labs/zksync-era#3752))
([e278ab5](matter-labs/zksync-era@e278ab5))
* **gateway:** Handle server shutting down error
([#3777](matter-labs/zksync-era#3777))
([8e11adc](matter-labs/zksync-era@8e11adc))
* **gateway:** Migration to Gateway
([#3654](matter-labs/zksync-era#3654))
([3c5e3c1](matter-labs/zksync-era@3c5e3c1))
* **main:** Eigenda add custom quorum params
([#3719](matter-labs/zksync-era#3719))
([dac58ad](matter-labs/zksync-era@dac58ad))
* Update zksync-protocol deps to 0.151.5
([#3790](matter-labs/zksync-era#3790))
([92beffe](matter-labs/zksync-era@92beffe))
* **zkos:** remove prev index pointer from leaves
([#3771](matter-labs/zksync-era#3771))
([5b8fd29](matter-labs/zksync-era@5b8fd29))


### Bug Fixes

* insert tokens without PG copy
([#3778](matter-labs/zksync-era#3778))
([b7a8152](matter-labs/zksync-era@b7a8152))
* **prover:** Force set all the `prover_job` labels to 0
([#3787](matter-labs/zksync-era#3787))
([3ecc8db](matter-labs/zksync-era@3ecc8db))
* **prover:** Reevaluation of 'heavy' jobs for WVG
([#3754](matter-labs/zksync-era#3754))
([2a8d33b](matter-labs/zksync-era@2a8d33b))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

---------

Co-authored-by: zksync-era-bot <zksync-era-bot@users.noreply.github.com>
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.

7 participants