-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
feat: add flag to enable/disable DA inclusion verification #2647
Conversation
Could you explain how would this work if, for some reason, inclusion has failed but the batch was committed? The proposed change as-is looks a bit dangerous. |
On the L1, a contract that is responsible for verifying the inclusion data is set in the diamond proxy storage. And the chain operator will be unable to change that easily, most likely it will be controlled by our governance/security council. Every time a batch is committed, the Executor facet calls it for an inclusion verification. |
I understand that. What I meant that even if we don't want to send inclusion data to L1, we still want to somehow make sure that it's persisted in the DA. If I understand things correctly, right now, for example, if a request to publish pubdata was sent, but it (asyncrhonously) failed, it will not be noticed and the sequencer will keep working, even though the DA is now broken. |
Ah, I see what you mean. The pubdata is not dispatched asynchronously, the batch won't be committed if the chain runs in validium mode and the inclusion data is |
But this PR changes that, because we return the inclusion data without actually ever checking that if was persisted. |
Not really, let me cover the full flow:
So we don't |
I see. Then shouldn't it be the property of the client? If there is no L1 confirmation data, I would expect this method of a concrete implementation to return immediately, rather than have a switch in the core (where we don't know if the config value is valid for a particular client). |
I'd say it's not about the confirmation data being/not being available in the client. I assume that all the clients will be capable of providing the inclusion proofs for L1 verification. It's more about the configuration of the chain as a whole - whether you as an operator want to verify the inclusion data or not(it adds some cost, so I assume many will be saving on it). We could move it to the clients' configs, but then we would just reimplement the same |
The difference here would be that only clients that have no inclusion data would have this My point is that I want to disallow misconfiguration here (e.g. set this variable to |
But it's not about the client having/not having the inclusion data. The client might have the inclusion data, it's just an operator's choice to either send it or not. What I meant here
is that I expect every client to be |
But the contract may reject the batch if it has to have inclusion data, right? That's the problem I want to avoid. I think I understand now that the setting on L1 isn't mapped 1-1 to the client capabilities (e.g. for a client with inclusion data, we may still ignore it on L1). |
great point, but it can't be done in that's why I have another PR into the sync-layer branch that adds some more logic for interacting with L1 contracts, and that's where I can add the safeguard you suggested consider this PR a solution for those who want to start using 3rd party DA solutions (in testing mode), before the new DA contracts are audited and used widely. they won't run into that misconfiguration because the contracts we have on testnet/mainnet don't check anything yet |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I get the idea now, and generally OK with it. However, please don't forget to add L1 checks once it's possible. Maybe even add a TODO in the code so it's harder to forget.
A few general comments.
core/lib/dal/migrations/20240813180616_data_availability_add_onchain_verification_flag.up.sql
Outdated
Show resolved
Hide resolved
## What ❔ <!-- What are the changes this PR brings about? --> <!-- Example: This PR adds a PR template to the repo. --> <!-- (For bigger PRs adding more context is appreciated) --> This PR adds a config to explicitly enable/disable DA verification onchain. ## Why ❔ Without this feature, any chain using custom DA had to wait for full inclusion before they could commit a batch even if they were not doing the onchain verification. ## 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 `zk fmt` and `zk lint`.
🤖 I have created a release *beep* *boop* --- ## [24.22.0](core-v24.21.0...core-v24.22.0) (2024-08-27) ### Features * add flag to enable/disable DA inclusion verification ([#2647](#2647)) ([b425561](b425561)) * **Base token:** add cbt metrics ([#2720](#2720)) ([58438eb](58438eb)) * Change default_protective_reads_persistence_enabled to false ([#2716](#2716)) ([8d0eee7](8d0eee7)) * **vm:** Extract oneshot VM executor interface ([#2671](#2671)) ([951d5f2](951d5f2)) * **zk_toolbox:** Add holesky testnet as layer1 network ([#2632](#2632)) ([d9266e5](d9266e5)) ### Bug Fixes * **api:** `tx.gas_price` field ([#2734](#2734)) ([aea3726](aea3726)) * **base_token_adjuster:** bug with a wrong metrics namespace ([#2744](#2744)) ([64b2ff8](64b2ff8)) * **eth-sender:** missing Gateway migration changes ([#2732](#2732)) ([a4170e9](a4170e9)) * **proof_data_handler:** TEE blob fetching error handling ([#2674](#2674)) ([c162510](c162510)) --- 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 <[email protected]>
What ❔
This PR adds a config to explicitly enable/disable DA verification onchain.
Why ❔
Without this feature, any chain using custom DA had to wait for full inclusion before they could commit a batch even if they were not doing the onchain verification.
Checklist
zk fmt
andzk lint
.