Skip to content

Conversation

JereSalo
Copy link
Contributor

@JereSalo JereSalo commented Mar 31, 2025

Validium is a scaling solution that enforces integrity of transactions using validity proofs like ZK-rollups, but doesn’t store transaction data on the Ethereum Mainnet.

Description

  • Replace EIP 4844 transactions for EIP 1559
  • Modify OnChainProposer contract so that it supports validium. It is not the most efficient way of doing it but the simplest.
  • Now the config.toml has a validium field.

Note: I'm not 100% sure about the changes that I made to the OnChainProposer, there may be a mistake in the additions that I made. I will review it though but I still consider worth opening this PR.

Closes #2313

@JereSalo JereSalo added the L2 Rollup client label Mar 31, 2025
@JereSalo JereSalo self-assigned this Mar 31, 2025
Copy link

github-actions bot commented Mar 31, 2025

Lines of code report

Total lines added: 65
Total lines removed: 0
Total lines changed: 65

Detailed view
+----------------------------------------------+-------+------+
| File                                         | Lines | Diff |
+----------------------------------------------+-------+------+
| ethrex/crates/l2/contracts/deployer.rs       | 798   | +32  |
+----------------------------------------------+-------+------+
| ethrex/crates/l2/sequencer/l1_committer.rs   | 423   | +29  |
+----------------------------------------------+-------+------+
| ethrex/crates/l2/utils/config/committer.rs   | 25    | +1   |
+----------------------------------------------+-------+------+
| ethrex/crates/l2/utils/config/toml_parser.rs | 263   | +3   |
+----------------------------------------------+-------+------+

@JereSalo JereSalo marked this pull request as ready for review March 31, 2025 21:40
@JereSalo JereSalo requested a review from a team as a code owner March 31, 2025 21:40
@@ -165,12 +177,15 @@ contract OnChainProposer is IOnChainProposer, ReentrancyGuard {
withdrawalsLogsMerkleRoot
);
}
blockCommitments[blockNumber] = BlockCommitmentInfo(
if (!VALIDIUM) {
Copy link
Member

Choose a reason for hiding this comment

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

Same here, this event should still be emitted in valiidum mode

Copy link
Contributor Author

Choose a reason for hiding this comment

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


// Remove previous block commitment as it is no longer needed.
delete blockCommitments[blockNumber - 1];
if (!VALIDIUM) {
Copy link
Member

Choose a reason for hiding this comment

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

Also here, this should still happen in validium mode

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok! I wasn't sure of that if statement but at moment I thought about not doing it in validium because the commitment that we have is zero. Thanks for pointing it out.
37e106d

@@ -159,7 +162,11 @@ impl Committer {
&account_updates,
)?;

let blobs_bundle = self.generate_blobs_bundle(&state_diff)?;
let blobs_bundle = if !self.validium {
self.generate_blobs_bundle(&state_diff)?
Copy link
Member

Choose a reason for hiding this comment

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

The call to prepare_state_diff can be moved inside the if case since there's no point in computing said state diff in validium mode (at least for now)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's right, I missed that one.
Fixed here

@jrchatruc
Copy link
Member

Let's add a version of the integration test to the CI that runs the same but in validium mode

@JereSalo JereSalo force-pushed the l2/add_validium_mode branch from cde26b6 to 63be86c Compare April 11, 2025 13:41
integration-test:
# "Integration Test" is a required check, don't change the name
name: Integration Test
test:
Copy link
Collaborator

Choose a reason for hiding this comment

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

you don't have unit tests? Because generally we have "Test" for unit tests and "Integration Test" for integration tests. Both are required checks

Copy link
Contributor

Choose a reason for hiding this comment

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

No we don't, I'll rollback the name change.

@ilitteri ilitteri added this pull request to the merge queue Apr 25, 2025
Merged via the queue into main with commit 09e7db7 Apr 25, 2025
28 checks passed
@ilitteri ilitteri deleted the l2/add_validium_mode branch April 25, 2025 15:09
pedrobergamini pushed a commit to pedrobergamini/ethrex that referenced this pull request Aug 24, 2025
Validium is a [scaling
solution](https://ethereum.org/en/developers/docs/scaling/) that
enforces integrity of transactions using validity proofs like
[ZK-rollups](https://ethereum.org/en/developers/docs/scaling/zk-rollups/),
but doesn’t store transaction data on the Ethereum Mainnet.

**Description**
- Replace EIP 4844 transactions for EIP 1559
- Modify OnChainProposer contract so that it supports validium. It is
not the most efficient way of doing it but the simplest.
- Now the config.toml has a validium field.

Note: I'm not 100% sure about the changes that I made to the
OnChainProposer, there may be a mistake in the additions that I made. I
will review it though but I still consider worth opening this PR.


<!-- Link to issues: Resolves lambdaclass#111, Resolves lambdaclass#222 -->

Closes lambdaclass#2313

---------

Co-authored-by: ilitteri <ilitteri@fi.uba.ar>
Co-authored-by: Ivan Litteri <67517699+ilitteri@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
L2 Rollup client
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add Validium Mode to the L2
4 participants