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

Make Rollbackable fields private #209

Merged
merged 69 commits into from
Sep 5, 2024
Merged

Conversation

juan518munoz
Copy link
Contributor

No description provided.

MarcosNicolau and others added 30 commits August 13, 2024 15:45
Fixes decommit opcode, which was not account for if the code had already been decommitted
Adds mandated gass, handles decommit cost err, and fixes the params of mimic call
@juan518munoz
Copy link
Contributor Author

juan518munoz commented Aug 28, 2024

@fkrause98 latest merge from main made most comments on this PR outdated, do you consider any of them still relevant?

Also, be sure to check the PR opened in zksync-era adapting to this changes whenever you have time to.

Copy link

github-actions bot commented Aug 28, 2024

Ergs comparison results:

╔═╡ Size (-%) ╞════════════════╡ All M3B3 ╞═╗
║ Mean                                0.000 ║
║ Best                                0.000 ║
║ Worst                               0.000 ║
║ Total                                 NaN ║
╠═╡ Cycles (-%) ╞══════════════╡ All M3B3 ╞═╣
║ Mean                              100.000 ║
║ Best                              100.000 ║
║ Worst                               0.000 ║
║ Total                             100.000 ║
╠═╡ Ergs (-%) ╞════════════════╡ All M3B3 ╞═╣
║ Mean                                7.941 ║
║ Best                               57.093 ║
║ Worst                               0.000 ║
║ Total                               9.985 ║
╚═══════════════════════════════════════════╝

╔═╡ Size (-%) ╞════════════════╡ All MzB3 ╞═╗
║ Mean                                0.000 ║
║ Best                                0.000 ║
║ Worst                               0.000 ║
║ Total                                 NaN ║
╠═╡ Cycles (-%) ╞══════════════╡ All MzB3 ╞═╣
║ Mean                                0.000 ║
║ Best                                0.000 ║
║ Worst                               0.000 ║
║ Total                                 NaN ║
╠═╡ Ergs (-%) ╞════════════════╡ All MzB3 ╞═╣
║ Mean                                0.000 ║
║ Best                                0.000 ║
║ Worst                               0.000 ║
║ Total                                 NaN ║
╚═══════════════════════════════════════════╝

╔═╡ Size (-%) ╞═════╡ EVMInterpreter M3B3 ╞═╗
║ Mean                                0.000 ║
║ Best                                0.000 ║
║ Worst                               0.000 ║
║ Total                                 NaN ║
╠═╡ Cycles (-%) ╞═══╡ EVMInterpreter M3B3 ╞═╣
║ Mean                              100.000 ║
║ Best                              100.000 ║
║ Worst                               0.000 ║
║ Total                             100.000 ║
╠═╡ Ergs (-%) ╞═════╡ EVMInterpreter M3B3 ╞═╣
║ Mean                                7.941 ║
║ Best                               57.093 ║
║ Worst                               0.000 ║
║ Total                               9.985 ║
╠═╡ Ergs/gas ╞══════╡ EVMInterpreter M3B3 ╞═╣
║ ADD                                60.750 ║
║ MUL                                36.450 ║
║ SUB                                60.750 ║
║ DIV                                44.850 ║
║ SDIV                               59.250 ║
║ MOD                                43.650 ║
║ SMOD                               58.050 ║
║ ADDMOD                             34.156 ║
║ MULMOD                             34.156 ║
║ EXP                                 8.537 ║
║ SIGNEXTEND                         42.450 ║
║ LT                                 64.750 ║
║ GT                                 64.750 ║
║ SLT                                88.750 ║
║ SGT                                86.750 ║
║ EQ                                 64.750 ║
║ ISZERO                             56.417 ║
║ AND                                58.750 ║
║ OR                                 60.750 ║
║ XOR                                60.750 ║
║ NOT                                52.417 ║
║ BYTE                               66.750 ║
║ SHL                                64.750 ║
║ SHR                                62.750 ║
║ SAR                                80.750 ║
║ SGT                                86.750 ║
║ SHA3                               27.647 ║
║ ADDRESS                            81.000 ║
║ BALANCE                            34.496 ║
║ ORIGIN                            398.594 ║
║ CALLER                             81.000 ║
║ CALLVALUE                          81.000 ║
║ CALLDATALOAD                       54.750 ║
║ CALLDATASIZE                       81.125 ║
║ CALLDATACOPY                       66.231 ║
║ CODESIZE                           81.625 ║
║ CODECOPY                          142.241 ║
║ GASPRICE                          404.219 ║
║ EXTCODESIZE                         3.590 ║
║ EXTCODECOPY                         3.664 ║
║ RETURNDATASIZE                     76.500 ║
║ RETURNDATACOPY                     51.778 ║
║ EXTCODEHASH                         5.489 ║
║ BLOCKHASH                          49.197 ║
║ COINBASE                          401.594 ║
║ TIMESTAMP                         398.594 ║
║ NUMBER                            398.594 ║
║ PREVRANDAO                        398.594 ║
║ GASLIMIT                          404.594 ║
║ CHAINID                           398.594 ║
║ SELFBALANCE                       261.863 ║
║ BASEFEE                           395.594 ║
║ POP                                65.625 ║
║ MLOAD                              71.931 ║
║ MSTORE                             75.696 ║
║ MSTORE8                            83.539 ║
║ SLOAD                              14.891 ║
║ SSTORE                              4.039 ║
║ JUMP                               32.444 ║
║ JUMPI                              30.455 ║
║ PC                                 81.500 ║
║ MSIZE                              88.000 ║
║ GAS                                81.500 ║
║ JUMPDEST                          114.000 ║
║ PUSH0                              75.500 ║
║ PUSH1                              62.083 ║
║ PUSH2                              65.500 ║
║ PUSH4                              68.333 ║
║ PUSH5                              69.750 ║
║ PUSH6                              71.167 ║
║ PUSH7                              72.583 ║
║ PUSH8                              74.000 ║
║ PUSH9                              75.417 ║
║ PUSH10                             76.833 ║
║ PUSH11                             78.250 ║
║ PUSH12                             79.667 ║
║ PUSH13                             81.083 ║
║ PUSH14                             82.500 ║
║ PUSH15                             83.917 ║
║ PUSH16                             85.333 ║
║ PUSH17                             86.750 ║
║ PUSH18                             88.167 ║
║ PUSH19                             89.583 ║
║ PUSH20                             91.000 ║
║ PUSH21                             92.417 ║
║ PUSH22                             93.833 ║
║ PUSH23                             95.250 ║
║ PUSH24                             96.667 ║
║ PUSH25                             98.083 ║
║ PUSH26                             99.500 ║
║ PUSH27                            100.917 ║
║ PUSH28                            102.333 ║
║ PUSH29                            103.750 ║
║ PUSH30                            105.167 ║
║ PUSH31                            106.583 ║
║ PUSH32                            106.000 ║
║ DUP1                               54.417 ║
║ DUP2                               58.417 ║
║ DUP3                               58.417 ║
║ DUP4                               58.417 ║
║ DUP5                               58.417 ║
║ DUP6                               58.417 ║
║ DUP7                               58.417 ║
║ DUP8                               58.417 ║
║ DUP9                               56.417 ║
║ DUP10                              58.417 ║
║ DUP11                              58.417 ║
║ DUP12                              58.417 ║
║ DUP13                              58.417 ║
║ DUP14                              58.417 ║
║ DUP15                              58.417 ║
║ DUP16                              58.417 ║
║ SWAP1                              59.083 ║
║ SWAP2                              59.083 ║
║ SWAP3                              59.083 ║
║ SWAP4                              59.083 ║
║ SWAP5                              59.083 ║
║ SWAP6                              59.083 ║
║ SWAP7                              59.083 ║
║ SWAP8                              59.083 ║
║ SWAP9                              59.083 ║
║ SWAP10                             59.083 ║
║ SWAP11                             59.083 ║
║ SWAP12                             59.083 ║
║ SWAP13                             59.083 ║
║ SWAP14                             59.083 ║
║ SWAP15                             59.083 ║
║ SWAP16                             57.083 ║
║ CALL                               42.789 ║
║ STATICCALL                         42.749 ║
║ DELEGATECALL                       42.469 ║
║ CREATE                              3.737 ║
║ CREATE2                             5.144 ║
║ RETURN                              1.000 ║
║ REVERT                              1.000 ║
╠═╡ Ergs/gas (-%) ╞═╡ EVMInterpreter M3B3 ╞═╣
║ BALANCE                            53.121 ║
║ ORIGIN                             70.963 ║
║ GASPRICE                           70.673 ║
║ EXTCODESIZE                        29.684 ║
║ EXTCODECOPY                        29.233 ║
║ EXTCODEHASH                        33.981 ║
║ BLOCKHASH                          79.764 ║
║ COINBASE                           70.808 ║
║ TIMESTAMP                          70.963 ║
║ NUMBER                             70.963 ║
║ PREVRANDAO                         70.963 ║
║ GASLIMIT                           70.654 ║
║ CHAINID                            70.963 ║
║ SELFBALANCE                        59.692 ║
║ BASEFEE                            71.118 ║
║ SLOAD                              44.878 ║
║ SSTORE                             55.336 ║
║ CALL                               31.292 ║
║ STATICCALL                         31.312 ║
║ DELEGATECALL                       30.698 ║
║ CREATE                             31.944 ║
║ CREATE2                            33.582 ║
╚═══════════════════════════════════════════╝

@fkrause98
Copy link
Contributor

@fkrause98 latest merge from main made most comments on this PR outdated, do you consider any of them still relevant?

Also, be sure to check the PR opened in zksync-era adapting to this changes whenever you have time to.

Let's ignore the comments I've left then.

MarcosNicolau and others added 9 commits August 29, 2024 14:48
* Add vm statistics

* Add tracking of precompiles cycles

* Add storage and decommit cycles

* Make opcode variant pub

* Add cycles counter

* Update zksync-era submodule

* Address clippy warnings

* Update era-compiler-tester submodule

* Update zksync-era submodule

* Fix initial value read in storage_changes

* Expose opcode variants

* Update zksync-era submodule

* Address review comments
@gianbelinche gianbelinche changed the base branch from main to zk_server_compatibility September 3, 2024 16:10
Base automatically changed from zk_server_compatibility to main September 4, 2024 20:18
src/state.rs Show resolved Hide resolved
@gianbelinche gianbelinche merged commit ddf0794 into main Sep 5, 2024
188 checks passed
@gianbelinche gianbelinche deleted the era_vm_rollbackable_priv_fields branch September 5, 2024 19:44
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