-
Notifications
You must be signed in to change notification settings - Fork 1
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: Validium mode + Fee Model V2 #66
base: main
Are you sure you want to change the base?
Conversation
FeeModelConfig::V2(config) => { | ||
let validium_mode = std::env::var("VALIDIUM_MODE") == Ok("true".to_owned()); | ||
FeeParams::V2(FeeParamsV2 { | ||
config, | ||
l1_gas_price: self.provider.estimate_effective_gas_price(), | ||
l1_pubdata_price: self.provider.estimate_effective_pubdata_price() | ||
* !validium_mode as u64, | ||
}) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can be left untouched. The provider's estimate_effective_pubdata_price
should return 0
instead in validium mode.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IIRC that's a configuration flag in chain.toml
.
Once the server is running, run this command in other terminal: | ||
|
||
```sh | ||
cargo run --release --bin zksync_full_stack |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is outdated I think. Shouldn't this be the example now?
* add variable to .toml * zk fmt
…m_mode_new_fee_model_final
…class/zksync-era into validium_mode_new_fee_model_final
Co-authored-by: Lyova Potyomkin <[email protected]>
…bel-external-contributions ci: add workflow to label external-contributions
Description
This PR merges the Validium mode that is working with the old fee model with the feature of the new fee model.
Changes
The commits are self-explanatory, so I'll list them and briefly describe what has been made on them.
era-contracts
andzksync_server
use.VALIDIUM_MODE
env set by theinit.ts
step.chain.toml
file but one, this isl1_pubdata_price
, which when set to 0 gives a huge gas use improvement in addition to the said config (yes, said config impacts the gas used by its own, settingl1_pubdata_price
to 0 lowers more the gas usage).Testing scenario
For comparing results between Rollup and Validium mode we are running the
validium_mode_example
binary with the system initialized both withzk init
andzk init --validium-mode
and running the server withzk server
.The
validium_mode_example
binary deposits some ETH to an account which will be used to deploy an ERC20 contract that is going to be called twice, for minting and transferring. For every mentioned action, some useful data like the transaction hash gas used will be printed to the stdout for later analysis.In parallel, we are also using a debugging tool developed by Marcin that displays batch info. It is very useful to see data like L2 -> L1 messages, Large L2 -> L1 messages, Published bytecodes, and writes to the storage. As a TLDR, it is a server from which you can query batches by number and analyze said data. It's easy to know in which batch a transaction has been added with the
eth_getTransactionByHash
method.In the section below you'll find a step-by-step guide to run said test scenario and see the results by yourself
Step-by-step
For running the example in Rollup mode
zk && zk clean --all && zk init
to initialize the system in Rollup mode in a clear environment.zk server
to run the server in one console.cargo run --release --bin validium_mode_example
to run the Validium mode example in another console.cd
into it.python3 operator/app.py
.http://127.0.0.1:5000
in your browser./batch/<batch_number>
For running the example in Validium mode
zk && zk clean --all && zk init --validium-mode
to initialize the system in Validium mode in a clear environment.zk server
to run the server in one console.cargo run --release --bin validium_mode_example
to run the Validium mode example in another console.cd
into it.python3 operator/app.py
.http://127.0.0.1:5000
in your browser./batch/<batch_number>
Results
Config:
max_pubdata_per_batch
pubdata_overhead_part
compute_overhead_part
batch_overhead_l1_gas
internal_enforced_l1_gas_price