-
Notifications
You must be signed in to change notification settings - Fork 303
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
CTL and range-check documentation #1368
Conversation
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.
A bit late for that, but I think it would have been much clearer to explain CTLs or LogUp with only one column, and then to say that we can easily extend it to multiple columns.
evm/spec/framework.tex
Outdated
@@ -33,5 +33,119 @@ \subsection{Field selection} | |||
|
|||
\subsection{Cross-table lookups} | |||
\label{ctl} | |||
The various STARK tables carry out indepedent operations, but on shared values. We need to check that the shared values are identical in all the STARKs that require them. This is where cross-table lookups (CTLs) come in handy. |
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.
The various STARK tables carry out indepedent operations, but on shared values. We need to check that the shared values are identical in all the STARKs that require them. This is where cross-table lookups (CTLs) come in handy. | |
The various STARK tables carry out independent operations, but on shared values. We need to check that the shared values are identical in all the STARKs that require them. This is where cross-table lookups (CTLs) come in handy. |
evm/spec/framework.tex
Outdated
TODO | ||
Suppose STARK $S_1$ requires an operation -- say $Op$ -- that is carried out by another STARK $S_2$. Then $S_1$ writes the input and output of $Op$ in its own table, and provides the inputs to $S_2$. $S_2$ also writes the inputs and outputs in its rows, and the table's constraints check that $Op$ is carried out correctly. We then need to ensure that the inputs and outputs are the same in $S_1$ and $S_2$. | ||
|
||
In other words, we need to ensure that the rows -- reduced to the inputs and outputs -- of $S_1$ calling $Op$ are permutations of the rows of $S_2$ that carry out $Op$. |
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.
we need to ensure that the rows -- reduced to the inputs and outputs --
I understand it, but it might not be clear for auditors. Maybe something like "the input and output columns"?
evm/spec/framework.tex
Outdated
|
||
In other words, we need to ensure that the rows -- reduced to the inputs and outputs -- of $S_1$ calling $Op$ are permutations of the rows of $S_2$ that carry out $Op$. | ||
|
||
To prove this, the first step is to only select the rows of interest in $S_1$ and $S_2$, and filter out the rest. Let $f_1$ be the filter for $S_1$ and $f_2$ the filter for $S_2$. $f_1$ and $f_2$ are constrained to be in $\{0, 1\}$. $f_1 = 1$ (resp. $f_2 = 1$) whenever the row at hand carries out $Op$ in $S_1$ (resp. in $S_2$), and 0 otherwise. Let also $(\alpha, \beta)$ be two challenges. |
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.
To prove this, the first step is to only select the rows of interest in $S_1$ and $S_2$, and filter out the rest. Let $f_1$ be the filter for $S_1$ and $f_2$ the filter for $S_2$. $f_1$ and $f_2$ are constrained to be in $\{0, 1\}$. $f_1 = 1$ (resp. $f_2 = 1$) whenever the row at hand carries out $Op$ in $S_1$ (resp. in $S_2$), and 0 otherwise. Let also $(\alpha, \beta)$ be two challenges. | |
To prove this, the first step is to only select the rows of interest in $S_1$ and $S_2$, and filter out the rest. Let $f_1$ be the filter for $S_1$ and $f_2$ the filter for $S_2$. $f_1$ and $f_2$ are constrained to be in $\{0, 1\}$. $f_1 = 1$ (resp. $f_2 = 1$) whenever the row at hand carries out $Op$ in $S_1$ (resp. in $S_2$), and 0 otherwise. Let also $(\alpha, \beta)$ be two random challenges. |
|
||
To prove this, the first step is to only select the rows of interest in $S_1$ and $S_2$, and filter out the rest. Let $f_1$ be the filter for $S_1$ and $f_2$ the filter for $S_2$. $f_1$ and $f_2$ are constrained to be in $\{0, 1\}$. $f_1 = 1$ (resp. $f_2 = 1$) whenever the row at hand carries out $Op$ in $S_1$ (resp. in $S_2$), and 0 otherwise. Let also $(\alpha, \beta)$ be two challenges. | ||
|
||
The idea is to create subtables $S_1'$ and $S_2'$ of $S_1$ and $S_2$ respectively, such that $f^1 = 1$ and $f^2 = 1$ for all their rows. The columns in the subtables are limited to the ones whose values must be identical (the inputs and outputs of $Op$ in our example). |
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.
$f^1 = 1$ and$f^2 = 1$
Why is the 1 and 2 in the exponent now?
evm/spec/framework.tex
Outdated
Z^{S_1}_{n-1} = 1 \\ | ||
Z^{S_1}_{i+1} = Z^{S_1}_i \cdot [f^1_i \cdot \Big(\sum_{j=0}^{m-1} \alpha^j \cdot c^{1, j}_i + \beta \Big) + (1 - f^1_i)] | ||
\end{gather*} | ||
Similarly, the prover constructs a running product $Z^{S_2}$for $S_2$. Note that $Z$ is computed ``upside down'': we start with $Z_{n-1} = 1$ and the final product is in $Z_1$. |
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.
Similarly, the prover constructs a running product $Z^{S_2}$for $S_2$. Note that $Z$ is computed ``upside down'': we start with $Z_{n-1} = 1$ and the final product is in $Z_1$. | |
Similarly, the prover constructs a running product $Z^{S_2}$for $S_2$. Note that $Z$ is computed ``upside down'': we start with $Z_{n-1} = 1$ and the final product is in $Z_0$. |
evm/spec/framework.tex
Outdated
\end{gather*} | ||
Similarly, the prover constructs a running product $Z^{S_2}$for $S_2$. Note that $Z$ is computed ``upside down'': we start with $Z_{n-1} = 1$ and the final product is in $Z_1$. | ||
|
||
On top of the constraints to check that the running products were correctly constructed, the verifier checks that $Z^{S_1}_1 = Z^{S_2}_1$. |
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.
On top of the constraints to check that the running products were correctly constructed, the verifier checks that $Z^{S_1}_1 = Z^{S_2}_1$. | |
On top of the constraints to check that the running products were correctly constructed, the verifier checks that $Z^{S_1}_0 = Z^{S_2}_0$. |
The prover defines a ``running product'' $Z$ for $S_1'$ such that: | ||
\begin{gather*} | ||
Z^{S_1}_{n-1} = 1 \\ | ||
Z^{S_1}_{i+1} = Z^{S_1}_i \cdot [f^1_i \cdot \Big(\sum_{j=0}^{m-1} \alpha^j \cdot c^{1, j}_i + \beta \Big) + (1 - f^1_i)] |
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.
[f^1_i \cdot \Big(\sum_{j=0}^{m-1} \alpha^j \cdot c^{1, j}_i + \beta \Big) + (1 - f^1_i)]
Maybe mention that this "selects" the terms you want, and filters out the rest?
evm/spec/framework.tex
Outdated
\subsubsection{What to range-check?} | ||
One can note that every element that ever appears on the stack has been pushed. Therefore, enforcing a range-check on pushed elements is enough to range-check all elements on the stack. Similarly, all elements in memory must have been written prior, and therefore it is enough to range-check memory writes. However, range-checking the PUSH and MSTORE opcodes is not sufficient. | ||
\begin{enumerate} | ||
\item Pushes and memory writes are range-checked in ``BytePackingStark''. |
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.
Only MSTORE_32BYTES is rangechecked by Bytepacking, MSTORE_GENERAL writes aren't (but have been rangechecked by a previous push).
evm/spec/framework.tex
Outdated
\begin{enumerate} | ||
\item ``EQ'' reads two -- already range-checked -- elements on the stack, and checks they are equal. The output is either 0 or 1, and does therefore not need to be checked. | ||
\item ``NOT'' reads one -- already range-checked -- element. The result is constrained to be equal to $\texttt{0xFFFFFFFF} - \texttt{input}$, which implicitly enforces the range check. | ||
\item ``PC'': the program counter cannot be greater than $2^{32}$ in user mode. Moreover, in kernel mode, one can only jump to valid jump destinations. These two points implicitly enforce $PC$'s range check. |
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.
cannot be greater than
$2^{32}$ in user mode
Maybe explain why (that it's not feasible to have user code longer than 2^32, and that a jump to anything else than a JUMPDEST would fail because of constraints).
Moreover, in kernel mode, one can only jump to valid jump destinations.
I find it unclear. I would rather say that every jump in the kernel is made to a location in the kernel, and that the kernel code is smaller than 2^32.
Kudos, SonarCloud Quality Gate passed! |
* Fix merging of jumpdest and keccak_general. * Add test for selfdestruct (#1321) * Add test for selfdestruct * Comment * Constrain uninitialized memory to 0 (#1318) * Fix typos in comments * Fix typos in comments * Add test for ERC20 transfer (#1331) * Working test * Minor * Cleaning * Remove `len` column in `KeccakSpongeStark` (#1334) * Remove len column in KeccakSpongeStark * Apply comment Co-authored-by: Robin Salen <30937548+Nashtare@users.noreply.github.com> --------- Co-authored-by: Robin Salen <30937548+Nashtare@users.noreply.github.com> * Add withdrawals (#1322) * Withdrawals * Remove AllRecursiveCircuits in withdrawals test * Fix ERC20 test * Add memory checks for prover_input, as well as range_checks for prover_input, syscalls/exceptions (#1168) * Add memory checks for prover_input and range_checks for prover_input, syscalls and exceptions * Replace u32 by U256, and remove extra CTLs * Add column in ArithmeticStark to use ctl_arithmetic_base_rows for is_range_check * Fix CTLs and circuit constraint. * Fix CTLs * restore `no-std` support (#1335) * perform test action on `x86_64-unknown-linux-gnu` and `wasm32-unknown-unknown` Signed-off-by: muraca <mmuraca247@gmail.com> * make `plonky2` build on `wasm32-unknown-unknown` Signed-off-by: muraca <mmuraca247@gmail.com> * make `starky` build on `wasm32-unknown-unknown` small oversight on `plonky2` fixed Signed-off-by: muraca <mmuraca247@gmail.com> * skip `evm` folder if target is `wasm32-unknown-unknown` Signed-off-by: muraca <mmuraca247@gmail.com> * add `default: true` to toolchain Signed-off-by: muraca <mmuraca247@gmail.com> * skip `test` if target is `wasm32-unknown-unknown` Signed-off-by: muraca <mmuraca247@gmail.com> * single ticks instead of double Signed-off-by: muraca <mmuraca247@gmail.com> * explicit target Signed-off-by: muraca <mmuraca247@gmail.com> * wasm32 job Signed-off-by: muraca <mmuraca247@gmail.com> * added `--no-default-features` to checks Signed-off-by: muraca <mmuraca247@gmail.com> --------- Signed-off-by: muraca <mmuraca247@gmail.com> * Move empty_check inside final iteration * Remove logic for multiple txns at once (#1341) * Have prover take only a single txn at most * Update comment * Apply review * Constrain clock (#1343) * Fix ranges in AllRecursiveCircuits initialization for log_opcode aggregation test (#1345) * Root out some unwraps * Range-check keccak sponge inputs to bytes (#1342) * Range-check keccak sponge inputs to bytes * Move outside of inner loop * Apply review * Charge gas for native instructions in interpreter (#1348) * Charge gas for native instructions in interpreter * Apply comment * Format * Remove unnecessary code duplication (#1349) * Remove unnecessary code duplication * Clippy * Add run_syscall and tests for sload and sstore (#1344) * Add run_syscall and tests for sload and sstore * Replace panics with errors and address comments * Apply comments * Change last addr name in prepare_interpreter * Fix kernel_mode in tests * Minor cleanup * Reduce visibility for a bunch of structs and methods in EVM crate (#1289) * Reduce visibility for a bunch of structs and methods * Remove redundant * Remove values of last memory channel (#1291) * Remove values of last memory channel Co-authored-by: Linda Guiga <lindaguiga3@gmail.com> * Fix merge * Apply comments * Fix ASM * Top stack documentation (#7) * Add doc file * Apply comments * Apply comments * Fix visibility * Fix visibility --------- Co-authored-by: Linda Guiga <lindaguiga3@gmail.com> * Fix MSTORE_32BYTES in interpreter (#1354) * Fix parsing of non-legacy receipts (#1356) * Fix parsing of non-legacy receipts * Clippy * Refactor JUMPDEST analysis (#1347) * Use table for JUMPDEST * Refactor jumpdest loop * Update comment --------- Co-authored-by: Robin Salen <salenrobin@gmail.com> * Add push constraints (#1352) * Add push constraints * Fix ranges * Add stack constraints * Implement out of gas exception (#1328) * Implement out of gas exception * Use gas constants in gas_cost_for_opcode * Remove comment * Merge public values inside prove_aggreg (#1358) * Constrain is_keccak_sponge (#1357) * Revert "Make gas fit in 2 limbs (#1261)" (#1361) * Revert "Make gas fit in 2 limbs (#1261)" This reverts commit 0f19cd0. * Comment * Update Memory in specs (#1362) * Update Memory specs * Apply comment Co-authored-by: Robin Salen <30937548+Nashtare@users.noreply.github.com> --------- Co-authored-by: Robin Salen <30937548+Nashtare@users.noreply.github.com> * Add doc for privileged instructions (#1355) * Add doc for privileged instructions * Comment * Update specs for Logic and Arithmetic Tables (#1363) * Update specs for Logic and Arithmetic * Apply comments * Reduce visibility (#1364) * Add specs for KeccakSponge (#1366) * Add specs for KeccakSponge * Apply comments * Update Keccak-f specs. (#1365) * Update Keccak-f specs. * Apply comments * wip * Create README.md * Update README.md * Update README.md Link 2 EVM Tests Repo * Update README.md * Update README.md (#1371) * CTL and range-check documentation (#1368) * CTL and range-check documentation * Apply comments * Add exceptions to specs (#1372) * Add exceptions to specs * Apply comments * Starting the specs for the CPU logic (#1377) * Add CPU logic section to specs * Add kernel specs * Apply comments --------- Co-authored-by: Hamy Ratoanina <hamy.ratoanina@toposware.com> * Initialize blockhashes (#1370) * Initialize blockhashes * Update comment * Check is_kernel_mode when halting (#1369) * Add specs for BytePackingStark (#1373) * Start * Finish documenting BytePackingStark * Apply comments * Apply comment --------- Co-authored-by: Robin Salen <salenrobin@gmail.com> * Add range check constraints for the looked table (#1380) * Add constraints to check that looked tables are well constructed for range checks * Fix comments * Explain difference between simple opcodes and syscalls (#1378) * Explain difference between simple opcodes and syscalls * Apply comment * Add specs for the CPU table (#1375) * Add specs for the CPU table * Add general columns * Apply comments * Apply comments * Backporting gas handling to the specs (#1379) * Backporting gas handling to the specs * Fix typo and syscall handling * Add specs for stack handling (#1381) * Add specs for stack handling * Apply comments * Add MPT specs * Update evm/spec/mpts.tex Co-authored-by: David <dvdplm@gmail.com> * Update evm/spec/mpts.tex Co-authored-by: David <dvdplm@gmail.com> * Update evm/spec/mpts.tex Co-authored-by: David <dvdplm@gmail.com> * Update evm/spec/mpts.tex Co-authored-by: David <dvdplm@gmail.com> * Update evm/spec/mpts.tex Co-authored-by: David <dvdplm@gmail.com> * Update evm/spec/mpts.tex Co-authored-by: David <dvdplm@gmail.com> * Fix typo in evm/spec/mpts.tex Co-authored-by: David <dvdplm@gmail.com> * Address comment * Remove redundant sect about MPT * Update evm/spec/mpts.tex Co-authored-by: wborgeaud <williamborgeaud@gmail.com> * Fix genesis block number in `prove_block` (#1382) * Fix genesis block number target * Add consistency check * Fix genesis block number * Revert pruning * Cleanup * Update error message with hashes * Fix and add comment * Make comment more explicit * Fix run_syscall in interpreter. (#1351) * Fix syscall and change sload test to catch the error * Update comment * Cleanup * comment * Remove extra rows in BytePackingStark (#1388) * Have at most one row per (un)packing operation in BytePackingStark * Change specs * Fix comment * Fix tests and apply comments * Fix log_opcodes * Add upgradeability to `AllRecursiveCircuits` and output verifier data (#1387) * Add upgradeable preprocessed sizes * Add verifier data * Changes in interpreter and implement interpreter version for add11 (#1359) * Fix interpreter, turn syscall opcodes into actual syscalls, create interpreter test for add11 * Rename test_add11 to test_add11_yml * Apply comments * Cleanup add11_yml interpreter test * Make stack_top() return a Result, and remove Result from add11_yml test * Apply comment * Move stack_len_bounds_aux to general columns (#1360) * Move stack_len_bounds_aux to general columns * Update specs * Apply comments * Apply comment * VerifierCircuitData Clone,PartialEq,Eq * chore: from_values takes ref * Optimize `num_bytes` and `hex_prefix_rlp` (#1384) * Compute num_bytes non-deterministically * Optimize hex_prefix_rlp * Clean code * Clippy * Apply suggestions Co-authored-by: Robin Salen <30937548+Nashtare@users.noreply.github.com> * Clean * Add endline * Change 1^256 to U256_MAX * Apply suggestions from code review Co-authored-by: Robin Salen <30937548+Nashtare@users.noreply.github.com> --------- Co-authored-by: Robin Salen <30937548+Nashtare@users.noreply.github.com> * Revert "chore: from_values takes ref" This reverts commit 7cc123e. * chore: Remove TODOs about `from_values` taking a reference * Remove bootstrapping (#1390) * Start removing bootstrapping * Change the constraint for kernel code initializing * Update specs * Apply comments * Add new global metadata to circuit methods * Change zero-initializing constraint * Apply comment * Update circuit size range for recursive test * Remove intermediary block bloom filters (#1395) * Remove intermediary block blooms * Update specs * Regenerate pdf * Apply comment, remove unneeded segment * Fix kernel codehash discrepancy (#1400) * Fix set_context constraints (#1401) * Fix set_context constraints * Apply comment * Pacify clippy (#1403) * Update stack op cost (#1402) * Update stack op cost * Update from review * Use logUp for CTLs (#1398) * Use LogUp for CTLs * Update specs * Invert in batch * Reorder framework sections * Implement `PublicValues` retrieval from public inputs (#1405) * Implement PublicValues retrieval from public inputs * Use utility method * Remove generic argument * Typo * Make some functions const (#1407) * Implement degree 2 filters (#1404) * Implement degree 2 filters * Apply comments * Remove GenerationOutputs (#1408) * Optimize asserts (#1411) * Implement MPT preinitialization (#1406) * Implement MPT preinitialization * Apply comments * Replace GlobalMetadata reads with stores in the kernel * Change memory specs * Remove trie data length as a prover input * Preinitialize all code segments (#1409) * Preinitialize all code segments * Add zero writes after code_size * Use preinitializing for extcodesize * Fix gas calculation * Extend logic to extcodecopy * Apply comments * Remove is_keccak_sponge (#1410) * Remove is_keccak_sponge * Apply comment * Use mstore_32bytes to optimize decode_int_given_len (#1413) * chore: fix some comment typos * Merge MSTORE_32BYTES and MLOAD_32BYTES columns (#1414) * Merge MSTORE_32BYTES and MLOAD_32BYTES columns * Fix circuit functions * Apply comments * Check that limbs after the length are 0 (#1419) * Check that limbs after the length are 0 * Update comments * Update comments * Add `Checkpoint` heights (#1418) * typo fix * typo fix * minor typo fix * typo fix * Fix a minor typo in evm/spec/cpulogic.tex * Merge `push` and `prover_input` flags (#1417) * Merge PUSH and PROVER_INPUT flags * Apply comment * Rebase to main * Refactor run_next_jumpdest_table_proof * Fix jumpdest analisys test * Constrain MSTORE_32BYTES new offset limbs (#1415) * Apply suggestions from code review Co-authored-by: Robin Salen <30937548+Nashtare@users.noreply.github.com> * fix: make `from_noncanonical_biguint` work for zero (#1427) * Eliminate nested simulations * Remove U256::as_u8 in comment * Fix fmt * Clippy * Add aborting signal (#1429) * Add aborting signal * Clippy * Update to Option following comment * Add ERC721 test (#1425) * Add ERC721 test * Add IS_READ column to BytePacking CTL * Apply comment * Change context to current context for BN precompiles (#1428) * Change context to current for BN precompiles * Rename segments * rustfmt * Added a Discord badge to `README.md` * Regenerate tries upon Kernel failure during `hash_final_tries` (#1424) * Generate computed tries in case of failure * Only output debug info when hashing final tries * Clippy * Apply comments * Add exceptions handling to the interpreter (#1393) * Add exceptions handling to the interpreter * Apply comments * Fix comments * Filter range checks (#1433) * Add filtering to range-checks * Cleanup * Fix Clippy * Apply comment * Constrain new top to loaded value in MLOAD_GENERAL (#1434) * Minor cleanup (#1435) * Improve proof generation * Constrain first offset of a segment (#1397) * Constrain first offset of a segment * Apply comment, revert debugging code * Modify specs * Apply comments * Remove aborts for invalid jumps * Rebase to main * Refactor run_next_jumpdest_table_proof * Fix jumpdest analisys test * Apply suggestions from code review Co-authored-by: Robin Salen <30937548+Nashtare@users.noreply.github.com> * Eliminate nested simulations * Remove U256::as_u8 in comment * Fix fmt * Clippy * Improve proof generation * Remove aborts for invalid jumps * Remove aborts for invalid jumps and Rebase * Clippy * add Debug trait to PartitionWitness to enable trace information output (#1437) * Refactor encode_empty_node and encode_branch_node Clean code Not important Restore jumpdets_analysis.asm Refactor encode_empty_node and encode_branch_node * Constrain partial_channel (#1436) * Add alternative method to prove txs without pre-loaded table circuits (#1438) * Rebase to main Refactor encode_empty_node and encode_branch_node Add constant and store encoded empty node in an other position Remove child segment Clean code Apply suggestions from code review Co-authored-by: Robin Salen <30937548+Nashtare@users.noreply.github.com> Remive global label Move encoded empty nodes * Remove duplicated label * Restore simple_transfer and Clippy * Clippy * Pacify latest clippy (#1442) * Add initial constraint z polynomial (#1440) * Prevent some lints from being allowed (#1443) * Add packed verification * Fix minor error * Minor * Apply suggestions from code review Co-authored-by: Linda Guiga <101227802+LindaGuiga@users.noreply.github.com> Co-authored-by: Robin Salen <30937548+Nashtare@users.noreply.github.com> * Address comments * Remove assertion in packed verif * Remove assertion * Add some more explicit doc on plonky2 crate * Rustdoc * Add comment * Remove gas check in sys_stop (#1448) * Address bundling (#1426) * Start * Scale TxnFields * Speed-up * Misc fixes * Other fixes * Fix * Fix offset * One more fix * And one more fix * Fix * Fix * Fix init * More interpreter fixes * Final fixes * Add helper methods * Clippy * Apply suggestions * Comments * Update documentation * Regenerate pdf * minor * Rename some macros for consistency * Add utility method for unscaling segments and scaled metadata * Address comments * Remove unused macro * Add crate-level documentation (#1444) * Add crate-level documentation * Revert change * Skip * Typo * Apply comments * Rephrase paragraph * Apply comments * Adress reviewer comments * Add some more + module doc * chore: fix typos (#1451) * Some more * Fix `after_mpt_delete_extension_branch` (#1449) * Fix after_mpt_delete_extension_branch * Rename test * PR feedback * Address review comments * Improve some calls to `%mstore_rlp` (#1452) * Improve some calls to mstore_rlp * Remove comment * Add Boolean constraints for `ArithmeticStark` (#1453) * Constrain IS_READ to be boolean * Constrain arithmetic flags to be boolean * Comment on memory stark * Implement CTL bundling (#1439) * Implement CTL bundling * Cleanup * Clippy * Preallocate memory * Apply comments and remove unnecessary functions. * Start removing clones * Set columns and filters inside if condition. * Remove extra CTL helper columns * Add circuit version, with cleanup and fixes * Remove some overhead * Use refs * Pacify clippy --------- Co-authored-by: Robin Salen <salenrobin@gmail.com> * Intra doc link * chore(evm,field,plonky2):fix typos (#1454) * Use current context in ecrecover (#1456) * Apply suggestions from code review Co-authored-by: Robin Salen <30937548+Nashtare@users.noreply.github.com> * Address comments * Missing review comments * Free up some CPU cycles (#1457) * Free up some cycles * Comments * Apply suggestions from code review Co-authored-by: Linda Guiga <101227802+LindaGuiga@users.noreply.github.com> * Constrain syscall/exceptions filter to be boolean (#1458) * Adress review comments * Update empty_txn_list * Fix comment * Apply review * Interpreter GenerationInputs (#1455) * Add initialization with GenerationInputs to the interpreter * Add new_with_generation_inputs_and_kernel * Apply comments * Remove full memory channel (#1450) * Remove a full memory channel * Remove unnecessary uses * Revert PDF change * Apply comments * Apply more comments * Move disabling functions to cpu_stark.rs * Apply comments * Bumped `eth_trie_utils` - Contains important fixes. * Add files via upload * Update README.md Add License / Contributing to readme * Update Cargo.toml Add license field to cargo manifest * Packed rlp prover inputs (#1460) * Pack rlp prover inputs * Fix endianness bug * Remove debug info and fix clippy * Fix clippy (#1464) * Fix fill_gaps (#1465) * Add math rendering with Katex (#1459) * fix: make add_generators public (#1463) * proofreading (#1466) * Fix simulation for jumpdest analysis (#1467) * Remove some CPU cycles (#1469) * Amortize mload_packing * Reduce stack overhead * Amortize mstore_unpacking * Speed-up stack operation in hash.asm * Misc * Small tweaks * Misc small optims * Fix comments * Fix main access to withdrawals * Fix stack description * minor: rename label * Comments --------- Co-authored-by: Linda Guiga <lindaguiga3@gmail.com> * Remove some more CPU cycles (#1472) * Speed-up some mload/mstore calls * Misc * Improve logs loop * Speed-up bloom * Speed-up access_lists loops * Fix * Speed up selfdestruct loop * Speed-up touched_addresses loop * Speed-up receipt loop * Skip rep loop * Fix * Misc * Review * Fix touched_addresses removal (#1473) * chore: update ci workflow (#1475) * chore: bump `actions/checkout` and `actions/cache` * chore: use `dtolnay/rust-toolchain` and `Swatinem/rust-cache` instead of outdated github actions * chore: use `cargo test` * chore: remove `actions-rs/cargo` * fix: typo * chore: enable to cancel in-progress jobs * chore: add job timeouts * Fix typos (#1479) * Fix interpreter jumps (#1471) * Fix interpreter jumps * Apply comments * Improve SHA2 precompile (#1480) * Improve SHA2 precompile * Review * Add removed global label * Improve `blake2f` call (#1477) * Improve on blake2 operations * Comments * Remove swap_mstore calls by changing stack macros * Speed-up `bn254` pairing operation (#1476) * Speed-up bn254 operations * Add comment for write_fp254_12_unit macro * Refactor some macros * nit: comment * Add newline * Improve `BIGNUM` operations (#1482) * Fix bugs in jumpdest analysis (#1474) * Fix simulation for jumpdest analysis * Fix bugs in jumpdest analysis * Update evm/src/cpu/kernel/asm/core/jumpdest_analysis.asm Co-authored-by: Robin Salen <30937548+Nashtare@users.noreply.github.com> * Address reviews --------- Co-authored-by: Robin Salen <30937548+Nashtare@users.noreply.github.com> * Fix circuit sizes (#1484) * Use web_time crate instead of std::time (#1481) * Use usize::BITS and wrapping_shr in reverse_index_bits_in_place_small (#1478) * Add LA audit report * Cleanup imports (#1492) * Fix BaseSumGenerator and BaseSplitGenerator Ids (#1494) * fix: different ids for generators with different bases required for correct serialisation Signed-off-by: electron-team <utsavjn48@gmail.com> * fixing wasm32 build issue Signed-off-by: electron-team <utsavjn48@gmail.com> * fix fmt issue Signed-off-by: electron-team <utsavjn48@gmail.com> --------- Signed-off-by: electron-team <utsavjn48@gmail.com> * Make CTLs more generic (#1493) * Make number of tables generic * Remove dependency on Table in the CTL module * Remove needless conversion * Remove more needless conversion * Clippy * Apply reviews * Reorganize lookup / ctl modules (#1495) * Reorganize lookup / ctl modules * Apply review * Some cleanup (#1498) * Remove StarkProofWithMetadata (#1497) * Add missing constraints mentioned by auditors (#1499) * Fix nightly version * Fix workflow * Switch permutation argument for logUp in `starky` (#1496) * Switch permutation argument for logUp in starky * Apply comments * Refactor check_lookup_options * Comments * Add more visibility * std -> core * Revert "Add more visibility" This reverts commit 2b4e50e. * Add more visibility to lookup items * Fix no-std tests and add corresponding jobs in the CI (#1501) * Revert "Remove StarkProofWithMetadata (#1497)" (#1502) This reverts commit af0259c. * Update new tests for Cancun --------- Signed-off-by: muraca <mmuraca247@gmail.com> Signed-off-by: electron-team <utsavjn48@gmail.com> Co-authored-by: Linda Guiga <lindaguiga3@gmail.com> Co-authored-by: wborgeaud <williamborgeaud@gmail.com> Co-authored-by: Hamy Ratoanina <hamy.ratoanina@toposware.com> Co-authored-by: shuoer86 <129674997+shuoer86@users.noreply.github.com> Co-authored-by: Linda Guiga <101227802+LindaGuiga@users.noreply.github.com> Co-authored-by: Matteo Muraca <56828990+muraca@users.noreply.github.com> Co-authored-by: David Palm <dvdplm@gmail.com> Co-authored-by: Paul Gebheim <pgebheim@users.noreply.github.com> Co-authored-by: Chris Tian <chris@succinct.xyz> Co-authored-by: 4l0n50 <alonso.gon@gmail.com> Co-authored-by: puma314 <puma314@users.noreply.github.com> Co-authored-by: yanziseeker <153156292+AdventureSeeker987@users.noreply.github.com> Co-authored-by: Ben <bmarsh94@gmail.com> Co-authored-by: Pioua <136521243+dzizazda@users.noreply.github.com> Co-authored-by: Ayush Shukla <shuklaayush247@gmail.com> Co-authored-by: BGluth <gluthb@gmail.com> Co-authored-by: Icer <liangshuangde@163.com> Co-authored-by: vuittont60 <81072379+vuittont60@users.noreply.github.com> Co-authored-by: Ratan Kaliani <ratankaliani@berkeley.edu> Co-authored-by: Ursulafe <152976968+Ursulafe@users.noreply.github.com> Co-authored-by: Léo Vincent <28714795+leovct@users.noreply.github.com> Co-authored-by: Thabokani <149070269+Thabokani@users.noreply.github.com> Co-authored-by: Vivek Pandya <vivekvpandya@gmail.com> Co-authored-by: Daniel Lubarov <daniel@lubarov.com> Co-authored-by: Utsav Jain <43694826+utsavjnn@users.noreply.github.com>
Add documentation for CTLs and range checks.