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

feat: Implement gas relay mode and inclusion data for data attestation #2987

Closed
wants to merge 268 commits into from

Conversation

QEDK
Copy link
Contributor

@QEDK QEDK commented Sep 30, 2024

What ❔

This PR adds gas relay API support for gasless submission to the Avail network, it also provides the attestation implementation necessary for data attestation.

Why ❔

Gas relay API support is required for Avail partners that choose to pay in a different token. Data attestation ensures that arbitrary tx data cannot be used for rollup finality and that no data withholding attack can occur.

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 zk fmt and zk lint.

StanislavBreadless and others added 30 commits May 15, 2024 01:43
…h-sync-layer-stable

Sb sync main with sync layer stable
## 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) -->

## Why ❔

<!-- Why are these changes done? What goal do they contribute to? What
are the principles behind them? -->
<!-- Example: PR templates ensure PR reviewers, observers, and future
iterators are in context about the evolution of repos. -->

## 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`.
- [ ] Spellcheck has been run via `zk spellcheck`.

---------

Co-authored-by: Stanislav Breadless <[email protected]>
Co-authored-by: Raid Ateir <[email protected]>
Co-authored-by: Raid5594 <[email protected]>
Co-authored-by: Igor Aleksanov <[email protected]>
Co-authored-by: Matías Ignacio González <[email protected]>
This PR changes the approach to managing 3rd party DA clients. It was
assumed before that they will be stored in a separate repository
(hyperchain-da), but to simplify the processes and solve a recursive
dependency problem, we decided to manage those within `zksync-era`.

The config now defines which DA client will be used, for proto-based
configuration it requires adding these lines to general.yaml:
```
da_client:
  avail:
    api_node_url: wss://turing-rpc.avail.so/ws
    bridge_api_url: undefined
    seed: SEED_PHRASE
    app_id: 82
    timeout: 3
    max_retries: 5
```
for env-based:
```
    DA_CLIENT="Avail"
    DA_API_NODE_URL="localhost:12345"
    DA_BRIDGE_API_URL="localhost:54321"
    DA_SEED="SEED_PHRASE"
    DA_APP_ID=1
    DA_TIMEOUT=2
    DA_MAX_RETRIES=3
```
If no config is provided - the default behavior is to use NoDA client
(same as now).

The `da_client` config might be merged with `da_dispatcher` at some
point as the second depends on the first one, so their separation does
not make much sense (apart from simplification of the configs). But I'd
prefer to do it as a separate PR in case we decide to merge them.

The client was reimplemented using only lightweight libraries from
crates.io, so it doesn't have any visible impact on build time.

To enable seamless integration with 3rd party DA clients in
`zksync-era`.

<!-- 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`.
## 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) -->

## Why ❔

<!-- Why are these changes done? What goal do they contribute to? What
are the principles behind them? -->
<!-- Example: PR templates ensure PR reviewers, observers, and future
iterators are in context about the evolution of repos. -->

## 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`.
## 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) -->

## Why ❔

<!-- Why are these changes done? What goal do they contribute to? What
are the principles behind them? -->
<!-- Example: PR templates ensure PR reviewers, observers, and future
iterators are in context about the evolution of repos. -->

## 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`.
@dimazhornyk dimazhornyk changed the base branch from dz-sync-layer-da-clients to main October 8, 2024 05:38
@dimazhornyk dimazhornyk requested a review from a team as a code owner October 8, 2024 05:38
@dimazhornyk dimazhornyk changed the base branch from main to dz-sync-layer-da-clients October 8, 2024 05:39
Copy link
Contributor

@dimazhornyk dimazhornyk left a comment

Choose a reason for hiding this comment

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

left some high level comments to note when changing PR destination branch

Cargo.lock Show resolved Hide resolved
Cargo.toml Show resolved Hide resolved
core/lib/protobuf_config/src/da_client.rs Show resolved Hide resolved
core/node/da_clients/src/avail/client.rs Show resolved Hide resolved
@QEDK QEDK changed the base branch from dz-sync-layer-da-clients to main October 10, 2024 21:57
@QEDK
Copy link
Contributor Author

QEDK commented Oct 10, 2024

Superseded by #3070 - closing.

@QEDK QEDK closed this Oct 10, 2024
github-merge-queue bot pushed a commit that referenced this pull request Oct 24, 2024
#3070)

## What ❔

This PR adds gas relay API support for gasless submission to the Avail
network, it also provides the attestation implementation necessary for
data attestation.

## Why ❔

Gas relay API support is required for Avail partners that choose to pay
in a different token. Data attestation ensures that arbitrary tx data
cannot be used for rollup finality and that no data withholding attack
can occur.

## Checklist

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

Supersedes #2987

---------

Co-authored-by: vibhurajeev <[email protected]>
Co-authored-by: dimazhornyk <[email protected]>
Co-authored-by: Dima Zhornyk <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants