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(vm): [DONT MERGE] 4844 POC #1056

Closed
wants to merge 67 commits into from
Closed

feat(vm): [DONT MERGE] 4844 POC #1056

wants to merge 67 commits into from

Conversation

koloz193
Copy link
Contributor

What ❔

Why ❔

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.
  • Spellcheck has been run via zk spellcheck.
  • Linkcheck has been run via zk linkcheck.

montekki and others added 30 commits January 31, 2024 13:05
@koloz193 koloz193 marked this pull request as ready for review February 13, 2024 22:28
@koloz193 koloz193 changed the title feat(vm): 4844 POC feat(vm): [DONT MERGE] 4844 POC Feb 13, 2024
Copy link
Contributor

Detected VM performance changes

Benchmark name Difference in runtime
call_far -37.5%

Copy link
Collaborator

@RomanBrodetski RomanBrodetski left a comment

Choose a reason for hiding this comment

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

I started to review it but then realized it's probably still in progress. But I left some comments anyway.

Are these generally all the changes required to start using eip4844? Is there migration plan somewhere I can read?

@@ -8,7 +8,7 @@ pub const ETHEREUM_ADDRESS: Address = Address::zero();
/// The maximum number of pubdata per L1 batch. This limit is due to the fact that the Ethereum
/// nodes do not accept transactions that have more than 128kb of pubdata.
/// The 18kb margin is left in case of any impreciseness of the pubdata calculation.
pub const MAX_PUBDATA_PER_L1_BATCH: u64 = 110000;
pub const MAX_PUBDATA_PER_L1_BATCH: u64 = 220000;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please update the comment above

i += 1;
}

output / denominator
Copy link
Collaborator

Choose a reason for hiding this comment

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

I vaguely remember this being discussed - this is temporary right? - please add comments on the migration strategy

/// The amount of ergs to be reserved at the end of the batch to ensure that it has enough ergs to verify compression, etc.
pub(crate) const BOOTLOADER_BATCH_TIP_OVERHEAD: u32 = 80_000_000;
pub(crate) const BOOTLOADER_BATCH_TIP_OVERHEAD_GAS: u32 = 200_000_000;
Copy link
Collaborator

Choose a reason for hiding this comment

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

can you please explain why we need this change

@@ -26,7 +26,7 @@ pub struct SystemL2ToL1Log(pub L2ToL1Log);
impl L2ToL1Log {
/// Determines the minimum number of items in the Merkle tree built from L2-to-L1 logs
/// for a certain batch.
pub const MIN_L2_L1_LOGS_TREE_SIZE: usize = 2048;
pub const MIN_L2_L1_LOGS_TREE_SIZE: usize = 4096;
Copy link
Collaborator

Choose a reason for hiding this comment

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

can you please explain why th this change is needed

.into_iter()
.take(MAX_NUMBER_OF_BATCH_COMMITS)
.collect(),
_ => unpublished_l1_batches
Copy link
Collaborator

Choose a reason for hiding this comment

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

hmmmbut why is it done here and this way? We have seal criteria NumberCriterion that is already initialized with different constants for different l1 ops. That is, different l1 operations already have different associated sealed criteria, so it's covered by last_l1_batch_to_publish.
Screenshot 2024-02-16 at 18 12 27

Copy link
Collaborator

Choose a reason for hiding this comment

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

ah looking further in code seems like it's temporary. But the PR is not marked as draft 😇

///
/// A commit operation may be either a blob transaction or a calldata
/// transaction. In case of a blob transaction the second field of
/// the returned tuple is `Some` and contains the encoded blob sidecar.
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think this comment is not updated


let kzg_settings = load_kzg_settings();

let side_car = op.l1_batches[0]
Copy link
Collaborator

Choose a reason for hiding this comment

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

I understand this is temporary?

@@ -414,6 +431,19 @@ impl EthTxManager {
opt.max_fee_per_gas = Some(U256::from(base_fee_per_gas + priority_fee_per_gas));
opt.max_priority_fee_per_gas = Some(U256::from(priority_fee_per_gas));
opt.nonce = Some(tx.nonce.0.into());
opt.transaction_type = if tx.blob_sidecar.is_some() {
opt.max_fee_per_blob_gas = blob_gas_price;
Copy link
Collaborator

Choose a reason for hiding this comment

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

hairsplitting: I feel like this is a rather convoluted way to assign fields.. Perhaps just match tx.blob_sidecar and assign variables that you need to assign in match arms

Copy link
Contributor

Detected VM performance changes

Benchmark name Difference in runtime
call_far -43.7%

@RomanBrodetski
Copy link
Collaborator

#1056 (comment) Is it true? @koloz193 cc @joonazan

@koloz193
Copy link
Contributor Author

#1056 (comment) Is it true? @koloz193 cc @joonazan

@RomanBrodetski hopefully this is not the case and was just a product of the POC code

github-merge-queue bot pushed a commit that referenced this pull request Feb 26, 2024
#1254)

## What ❔

Splits the part off of #1056 

## 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`.
- [ ] Linkcheck has been run via `zk linkcheck`.
@popzxc
Copy link
Member

popzxc commented Mar 15, 2024

@koloz193 given that it's a PoC, can this PR be closed now?

@koloz193
Copy link
Contributor Author

@koloz193 given that it's a PoC, can this PR be closed now?

Yes, I’ll close it out

@koloz193 koloz193 closed this Mar 15, 2024
@popzxc popzxc deleted the zk-pds-poc branch March 15, 2024 13:28
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.

5 participants