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

refactor(protobuf): relocate types from zksync_protobuf_config (BFT-407) #66

Merged
merged 5 commits into from
Feb 15, 2024

Conversation

moshababo
Copy link
Contributor

@moshababo moshababo commented Feb 13, 2024

What ❔

Relocating ProtoRepr the following types and utils from zksync_protobuf_config (zksync-era) into zksync_protobuf (era-consensus). This PR just adds them to the new location.

  • trait ProtoRepr
  • fn read_required_repr
  • fn encode<P: ProtoRepr>
  • fn decode<P: ProtoRepr>
  • trait RandomValue
  • struct GenValue

Why ❔

To make them usable as a shared utility.

@brunoffranca brunoffranca changed the title refactor(protobuf): relocate ProtoRepr trait refactor(protobuf): relocate ProtoRepr trait (BFT-407) Feb 13, 2024
@moshababo
Copy link
Contributor Author

Added a few more types/utils.

@moshababo moshababo changed the title refactor(protobuf): relocate ProtoRepr trait (BFT-407) refactor(protobuf): relocate types from zksync_protobuf_config (BFT-407) Feb 14, 2024
@moshababo moshababo merged commit 97d1399 into main Feb 15, 2024
4 checks passed
@moshababo moshababo deleted the add_proto_repr branch February 15, 2024 23:22
github-merge-queue bot pushed a commit to matter-labs/zksync-era that referenced this pull request Feb 27, 2024
…ing (BFT-407) (#1047)

## What ❔

Adding `zksync_types::Transaction` support for cannonical-protobuf
encoding.
Existing `serde` encoding remains intact—protobuf is used only for the
construction of the consensus block payload.

Closing
[BFT-407](https://linear.app/matterlabs/issue/BFT-407/optimize-rlp-encoding-of-transaction-struct).

---

In addition, `zksync_consensus_*` dependencies were updated to include
matter-labs/era-consensus#66, and the relocated
types were adjusted.

---

<!-- 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 ❔

* Better composability with the consensus block payload 
* Support for potential version control / backward compatibility 
* Having a deterministic + unique scheme

<!-- 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. -->

- [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 `zk fmt` and `zk lint`.
- [x] Spellcheck has been run via `zk spellcheck`.
- [x] Linkcheck has been run via `zk linkcheck`.

---------

Co-authored-by: perekopskiy <[email protected]>
github-merge-queue bot pushed a commit to matter-labs/zksync-era that referenced this pull request Feb 28, 2024
…ing (BFT-407) (#1047)

## What ❔

Adding `zksync_types::Transaction` support for cannonical-protobuf
encoding.
Existing `serde` encoding remains intact—protobuf is used only for the
construction of the consensus block payload.

Closing
[BFT-407](https://linear.app/matterlabs/issue/BFT-407/optimize-rlp-encoding-of-transaction-struct).

---

In addition, `zksync_consensus_*` dependencies were updated to include
matter-labs/era-consensus#66, and the relocated
types were adjusted.

---

<!-- 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 ❔

* Better composability with the consensus block payload 
* Support for potential version control / backward compatibility 
* Having a deterministic + unique scheme

<!-- 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. -->

- [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 `zk fmt` and `zk lint`.
- [x] Spellcheck has been run via `zk spellcheck`.
- [x] Linkcheck has been run via `zk linkcheck`.

---------

Signed-off-by: Danil <[email protected]>
Co-authored-by: perekopskiy <[email protected]>
Co-authored-by: koloz193 <[email protected]>
Co-authored-by: Fedor Sakharov <[email protected]>
Co-authored-by: Danil <[email protected]>
Co-authored-by: Ivan Schasny <[email protected]>
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.

3 participants