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: Implemented 1 validator consensus for the main node #554

Merged
merged 31 commits into from
Dec 12, 2023

Conversation

pompon0
Copy link
Contributor

@pompon0 pompon0 commented Nov 28, 2023

What ❔

Implemented 1 validator consensus for the main node.
It is NOT enabled yet, corresponding configuration still needs to be provided.
It is responsible for populating consensus column in the Miniblocks table.
Consensus will be running asynchronously for now, not affecting the miniblock production at all.

Fixes BFT-388.

Why ❔

Reaching a consensus with just 1 validator doesn't provide much value, however we want to start running the consensus code in production (in a "shadow" mode) to make sure it works as expected before we start relying on it.

core/lib/zksync_core/src/consensus/storage/mod.rs Outdated Show resolved Hide resolved
core/lib/zksync_core/src/consensus/storage/mod.rs Outdated Show resolved Hide resolved
core/lib/zksync_core/src/consensus/storage/mod.rs Outdated Show resolved Hide resolved
core/lib/zksync_core/src/consensus/storage/mod.rs Outdated Show resolved Hide resolved
core/lib/zksync_core/src/consensus/storage/mod.rs Outdated Show resolved Hide resolved
core/lib/zksync_core/src/consensus/storage/mod.rs Outdated Show resolved Hide resolved
core/lib/zksync_core/src/consensus/wrap_error.rs Outdated Show resolved Hide resolved
core/lib/zksync_core/src/consensus/storage/mod.rs Outdated Show resolved Hide resolved
core/lib/zksync_core/src/consensus/storage/mod.rs Outdated Show resolved Hide resolved
core/lib/zksync_core/src/consensus/wrap_error.rs Outdated Show resolved Hide resolved
@pompon0 pompon0 marked this pull request as ready for review December 6, 2023 10:39
@pompon0 pompon0 requested a review from a team as a code owner December 6, 2023 10:39
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 think there's an opportunity to share some main / test code with the EN-related consensus logic. I can do this in a follow-up PR after this one is merged.

core/lib/zksync_core/src/consensus/storage.rs Outdated Show resolved Hide resolved
core/lib/zksync_core/src/consensus/storage.rs Outdated Show resolved Hide resolved
core/lib/zksync_core/src/consensus/storage.rs Show resolved Hide resolved
core/lib/zksync_core/src/consensus/storage.rs Outdated Show resolved Hide resolved
core/lib/zksync_core/src/consensus/storage.rs Outdated Show resolved Hide resolved
core/lib/zksync_core/src/consensus/testonly.rs Outdated Show resolved Hide resolved
core/lib/zksync_core/src/consensus/tests.rs Outdated Show resolved Hide resolved
core/lib/zksync_core/src/consensus/tests.rs Outdated Show resolved Hide resolved
core/lib/zksync_core/src/consensus/tests.rs Show resolved Hide resolved
core/lib/zksync_core/src/consensus/testonly.rs Outdated Show resolved Hide resolved
pompon0 added a commit to matter-labs/era-consensus that referenced this pull request Dec 7, 2023
We need a way to delegate proposing/verifying the block's payload to the
user.
See the related pr: matter-labs/zksync-era#554

Additionally introduced stronger typing for signed messages in bft
tests.

Fixes BFT-388.
@pompon0 pompon0 requested a review from slowli December 7, 2023 16:28
slowli
slowli previously approved these changes Dec 11, 2023
core/lib/dal/src/blocks_dal.rs Outdated Show resolved Hide resolved
core/lib/zksync_core/src/consensus/mod.rs Outdated Show resolved Hide resolved
core/lib/zksync_core/src/consensus/mod.rs Show resolved Hide resolved
core/lib/zksync_core/src/consensus/tests.rs Outdated Show resolved Hide resolved
core/lib/zksync_core/src/sync_layer/tests.rs Outdated Show resolved Hide resolved
core/lib/zksync_core/Cargo.toml Outdated Show resolved Hide resolved
core/lib/zksync_core/src/consensus/storage.rs Outdated Show resolved Hide resolved
brunoffranca
brunoffranca previously approved these changes Dec 11, 2023
brunoffranca
brunoffranca previously approved these changes Dec 12, 2023
@pompon0 pompon0 added this pull request to the merge queue Dec 12, 2023
Merged via the queue into main with commit 9c59838 Dec 12, 2023
23 checks passed
@pompon0 pompon0 deleted the gprusak-consensus2 branch December 12, 2023 18:07
github-merge-queue bot pushed a commit that referenced this pull request Dec 13, 2023
🤖 I have created a release *beep* *boop*
---


##
[18.8.0](core-v18.7.0...core-v18.8.0)
(2023-12-13)


### Features

* **api:** Sunset API translator
([#675](#675))
([846fd33](846fd33))
* **core:** Merge bounded and unbounded gas adjuster
([#678](#678))
([f3c3bf5](f3c3bf5))
* **dal:** Make ConnectionPoolBuilder owned
([#676](#676))
([1153c42](1153c42))
* Implemented 1 validator consensus for the main node
([#554](#554))
([9c59838](9c59838))
* **merkle tree:** Snapshot recovery in metadata calculator
([#607](#607))
([f49418b](f49418b))


### Bug Fixes

* dropping installed filters
([#670](#670))
([985c737](985c737))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).
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