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

Write trie roots to memory before kernel bootstrapping #1172

Merged
merged 6 commits into from
Aug 9, 2023

Conversation

wborgeaud
Copy link
Contributor

See #1164 for discussion.
NB: This PR breaks the EVM test runner. Will open a PR to fix the runner once this is merged.

Copy link
Collaborator

@Nashtare Nashtare left a comment

Choose a reason for hiding this comment

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

One nit comment otherwise looks good to me. That's indeed much nicer without this cpu_trace_len floating around.

let metadata = &inputs.block_metadata;
let tries = &inputs.tries;
let trie_roots_after = &inputs.trie_roots_after;
let h2u = |h: H256| U256::from_big_endian(&h.0);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Minor, but maybe this would deserve a dedicated function declaration in evm/src/util.rs?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good idea, done.

@@ -15,7 +15,7 @@ use plonky2_evm::all_stark::AllStark;
use plonky2_evm::config::StarkConfig;
use plonky2_evm::generation::mpt::AccountRlp;
use plonky2_evm::generation::{GenerationInputs, TrieInputs};
use plonky2_evm::proof::BlockMetadata;
use plonky2_evm::proof::{BlockMetadata, TrieRoots};
Copy link
Collaborator

Choose a reason for hiding this comment

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

I don't think it is related to this PR, but this test seems to fail, do you have a clue why?

Error: KernelPanic in kernel at pc=panic, stack=[41225], memory=[58, 81, 65, 118, 70, 111, 168, 21, 237, 72, 31, 250, 208, 145, 16, 162, 211, 68, 246, 201, 183, 140, 29, 20, 175, 195, 81, 195, 165, 27, 227, 61, 128, 114, 231, 121, 57, 220, 3, 186, 68, 121, 7, 121, 183, 161, 2, 91, 175, 48, 3, 246, 115, 36, 48, 226, 12, 217, 183, 109, 149, 51, 145, 179]

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah this test and also test_basic_smart_contract have been failing for some time now. I don't know why, but will try to investigate.

@wborgeaud wborgeaud merged commit df07ae0 into main Aug 9, 2023
@wborgeaud wborgeaud deleted the write_trie_roots branch August 9, 2023 08:15
github-merge-queue bot pushed a commit to 0xmozak/plonky2 that referenced this pull request Aug 11, 2023
* Make GateRef value public

* Better document constraints on addcy carries (0xPolygonZero#1139)

* Add missing constraints on addcy carries.

* Remove bit-checks; make documentation clearer.

* Constrain keccak general

* Reuse set_public_value_targets

* Fix endianness in benefiary limbs

* Convert to u32 instead of u64

* Clippy

* Silence Poseidon warnings for ARM targets

* Remove unused attributes

* Fix trait import. (0xPolygonZero#1163)

* Error instead of panicking for missing preprocessed circuits (0xPolygonZero#1159)

* Set exception flag to 1.

* Connect public values in aggregation circuit (0xPolygonZero#1169)

* Connect public values in aggregation circuit

* Minor

* Write trie roots to memory before kernel bootstrapping  (0xPolygonZero#1172)

* Write trie roots

* Remove CPU trace length

* Update hash_initial/final_tries

* Fix tests

* Minor

* PR feedback

* Connect SHL/SHR operations to the Arithmetic table (0xPolygonZero#1166)

* Add corresponding arithmetic operations to shift ones

* Include SHL/SHR in the arithmetic CTL

* Prevent overflow

* Expand documentation for ctl_data_ternops()

---------

Co-authored-by: Dimo99 <dimodimov1999@gmail.com>
Co-authored-by: Hamish Ivey-Law <426294+unzvfu@users.noreply.github.com>
Co-authored-by: Robin Salen <salenrobin@gmail.com>
Co-authored-by: Robin Salen <30937548+Nashtare@users.noreply.github.com>
Co-authored-by: Jacqueline Nabaglo <jakub@mirprotocol.org>
Co-authored-by: Nicholas Ward <npward@berkeley.edu>
Co-authored-by: Linda Guiga <lindaguiga3@gmail.com>
Co-authored-by: wborgeaud <williamborgeaud@gmail.com>
github-merge-queue bot pushed a commit to 0xmozak/plonky2 that referenced this pull request Sep 15, 2023
* Make GateRef value public

* Better document constraints on addcy carries (0xPolygonZero#1139)

* Add missing constraints on addcy carries.

* Remove bit-checks; make documentation clearer.

* Constrain keccak general

* Reuse set_public_value_targets

* Fix endianness in benefiary limbs

* Convert to u32 instead of u64

* Clippy

* Silence Poseidon warnings for ARM targets

* Remove unused attributes

* Fix trait import. (0xPolygonZero#1163)

* Error instead of panicking for missing preprocessed circuits (0xPolygonZero#1159)

* Set exception flag to 1.

* Connect public values in aggregation circuit (0xPolygonZero#1169)

* Connect public values in aggregation circuit

* Minor

* Write trie roots to memory before kernel bootstrapping  (0xPolygonZero#1172)

* Write trie roots

* Remove CPU trace length

* Update hash_initial/final_tries

* Fix tests

* Minor

* PR feedback

* Connect SHL/SHR operations to the Arithmetic table (0xPolygonZero#1166)

* Add corresponding arithmetic operations to shift ones

* Include SHL/SHR in the arithmetic CTL

* Prevent overflow

* Expand documentation for ctl_data_ternops()

* Combine AND and OR flags in CpuStark

* Reduce reallocations

* Address review

* Apply Nicholas comment

* Revert changes in cyclic_subgroup_unknown_order

* Fix logic CTL

* Combine all logic flags together

* Comment

* Combine EQ and ISZERO flags

* Combine jump flags

* Add guidance for external contributors to README.md

* Use Keccak config in simple tests

* Remove is_cpu_cycle

* Remove is_bootstrap_kernel column

* Implement inverse from Fermat little theorem (0xPolygonZero#1176)

* Add inverse from Fermat little theorem

* Remove inlining for goldilocks try_inverse method

* Remove copy on write for mpt_insert and mpt_delete

* Combine a few constraints

* Reduce overconstraining in decode module

* Remove filtering in membus

* Observe public values

* Update tests to have a blockgaslimit fitting u32s

* Update BlockBaseFee to fit in 2 limbs

* Refactor

* Apply comment

* Combine get_context and set_context into one flag

* Remove unnecessary changes in the Operation enum

* Apply comment

* Patched plonky2 to use a patch for eth_trie_utils

* Implement receipts and logs

Co-authored-by: Hamy Ratoanina <hamy.ratoanina@toposware.com>
Co-authored-by: Linda Guiga <lindaguiga3@gmail.com>

* Cleanup

* Fix tests and address comments

* Change receipts_trie in basic_smart_contract and self_balance_gas_cost

* Cleanup

* Clippy

* Made `PublicValues` serializable

- Needed by the prover scheduler.

* make generate partial_witness pub

* Update range from ReceiptTrie PR

* fix: constrain higher bits of reg_preimage

* Keccak STARK: constraint preimage to equal A on first round

* Constrain next row's stack length

* Add missing links between public values

* Implement receipts of types 1 and 2

* Apply comments

* Fix comment in `proof.rs`

* Apply comments

* Replace genesis state trie check with TODO

* feat: serde for targets

* Display actual trace lengths instead of number of ops

* Remove duplicate code

* Remove filter column for KeccakStark

* Added mock feature flag and test

* remove spurious

* Add blockhash sys opcode

* Apply comments

* Change h256_ulimbs

* Fix overflow check and test. Remove [..8] when using h256_limbs.

* Clippy

* Fix memop reads, from_prover_inputs and cleanup.

* Fix Clippy

* Removed mock feature flag and added mock_build

* clippy

* Now builds on the latest nightly

* Also included clippy fixes introduced by new nightly

* Apply Nick's comment

* Apply Nick's comment

* Now refers to sub-crates using paths (and removed `patch` section)

- Previously refered to specific `crates.io` versions.
- Motivation for this is to allow external projects to be able use
  specific revisions of this repo. Without this, a `[patch]` section
  is almost always required in the external project in order to force
  the internal plonky2 sub-crates to the same version, an approach which
  comes with its own issues.

* Fixes

* clippy

* Made visibilities outside of crate to allow for forking partial witness gen outside of crate

* latest nightly in CI and rust-toolchain

* suppress incorrect Clippy error

* fmt

* clippy suggestions

* clippy suggestions

* clippy suggestions

* clippy suggestions

* clippy suggestions

* more clippy suggestions

* Move byte packing / unpacking to a distinct table (0xPolygonZero#1212)

* Duplicate Memory trace into BytePacking one

* Add mload_32bytes instruction

* Use dedicated ops for byte packing trace

* Change witness generation to reduce memory reads for MLOAD_32BYTES

* Remove segments

* Fix stack

* Fix extra product when fixing CTL for byte_packing

* Write output value in trace

* Add constraints for BYTE_PACKING table

* Add recursive constraints for BYTE_PACKING table

* Fix constraints

* Add address in trace and constraints

* Add timestamp and batch inputs into BytePackingOp struct

* Add extra column

* Fix BytePackingStark CTL

* Tiny fix in witness generation

* Fix the Memory CTL

* Add constraints for the new columns

* Remove 1 column

* Remove limb columns

* Fix

* Fix recursive circuit of BytePackingTable

* Fix constraints

* Fix endianness

* Add MSTORE_32BYTES instruction and move decomposition to packing table

* Add missing constraint

* Add range-check for all bytes

* Add extra constraint

* Cleanup

* Remove REMAINING_LEN column

* Add corresponding implementations in interpreter

* Fix recursive version

* Remove debug assertion because of CI

* Remove FILTER column

* Update new test from rebasing

* Reorder STARK modules to match TraceCheckPoint ordering

* Address comments

* Pacify clippy

* Add documentation to the packing module

* Fix doctest

* Swap ordering in stack macro (0xPolygonZero#1230)

* Swap ordering in stack macro

* Update comment

* Fix self_balance_gas_cost and basic_smart_contract. (0xPolygonZero#1227)

* Fix self_balance_gas_cost and basic_smart_contract.

* Fix Clippy

* Combine arithmetic flags on the CPU side (0xPolygonZero#1187)

* Combine FP254 flags

* Combine basic binary ops together and do CTL with opcode value

* Combine ternary ops together

* Combine MUL DIV and MOD

* Combine shift operations

* Combine byte with other binary ops

* Fix tests

* Clean leftover comment

* Update from latest main

* Put the 'is_simulated' flag inside the Operation enum

* Cleaner way to handle "simulated" operations SHL and SHR.

* Fix comments.

* Minor: suggestion for re-expressing `combined_ops`.

* Update comment

---------

Co-authored-by: Hamish Ivey-Law <hamish@ivey-law.name>

* Remove redundant Keccak sponge cols (0xPolygonZero#1233)

* Rename columns in KeccakSponge for clarity

* Remove redundant columns

* Apply comments

* Combine mstore_general and mload_general into one flag (0xPolygonZero#1188)

* Combine mstore_general and mload_general into one flag

* Add comments and make stack constraints cleaner.

* Fix number of native instructions

* Ordering

* Cleanup

* Update calls to stack eval from latest main

---------

Co-authored-by: Robin Salen <salenrobin@gmail.com>

---------

Co-authored-by: Dimo99 <dimodimov1999@gmail.com>
Co-authored-by: Hamish Ivey-Law <426294+unzvfu@users.noreply.github.com>
Co-authored-by: Robin Salen <salenrobin@gmail.com>
Co-authored-by: Robin Salen <30937548+Nashtare@users.noreply.github.com>
Co-authored-by: Jacqueline Nabaglo <jakub@mirprotocol.org>
Co-authored-by: Nicholas Ward <npward@berkeley.edu>
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: BGluth <gluthb@gmail.com>
Co-authored-by: Linda Guiga <101227802+LindaGuiga@users.noreply.github.com>
Co-authored-by: John Guibas <john@succinct.xyz>
Co-authored-by: Daniel Lubarov <daniel@lubarov.com>
Co-authored-by: Ayush Shukla <shuklaayush247@gmail.com>
Co-authored-by: Uma Roy <uma.roy.us@gmail.com>
Co-authored-by: Hamish Ivey-Law <hamish@ivey-law.name>
sai-deng pushed a commit to 0xmozak/plonky2 that referenced this pull request Jul 18, 2024
* Make GateRef value public

* Better document constraints on addcy carries (0xPolygonZero#1139)

* Add missing constraints on addcy carries.

* Remove bit-checks; make documentation clearer.

* Constrain keccak general

* Reuse set_public_value_targets

* Fix endianness in benefiary limbs

* Convert to u32 instead of u64

* Clippy

* Silence Poseidon warnings for ARM targets

* Remove unused attributes

* Fix trait import. (0xPolygonZero#1163)

* Error instead of panicking for missing preprocessed circuits (0xPolygonZero#1159)

* Set exception flag to 1.

* Connect public values in aggregation circuit (0xPolygonZero#1169)

* Connect public values in aggregation circuit

* Minor

* Write trie roots to memory before kernel bootstrapping  (0xPolygonZero#1172)

* Write trie roots

* Remove CPU trace length

* Update hash_initial/final_tries

* Fix tests

* Minor

* PR feedback

* Connect SHL/SHR operations to the Arithmetic table (0xPolygonZero#1166)

* Add corresponding arithmetic operations to shift ones

* Include SHL/SHR in the arithmetic CTL

* Prevent overflow

* Expand documentation for ctl_data_ternops()

* Combine AND and OR flags in CpuStark

* Reduce reallocations

* Address review

* Apply Nicholas comment

* Revert changes in cyclic_subgroup_unknown_order

* Fix logic CTL

* Combine all logic flags together

* Comment

* Combine EQ and ISZERO flags

* Combine jump flags

* Add guidance for external contributors to README.md

* Use Keccak config in simple tests

* Remove is_cpu_cycle

* Remove is_bootstrap_kernel column

* Implement inverse from Fermat little theorem (0xPolygonZero#1176)

* Add inverse from Fermat little theorem

* Remove inlining for goldilocks try_inverse method

* Remove copy on write for mpt_insert and mpt_delete

* Combine a few constraints

* Reduce overconstraining in decode module

* Remove filtering in membus

* Observe public values

* Update tests to have a blockgaslimit fitting u32s

* Update BlockBaseFee to fit in 2 limbs

* Refactor

* Apply comment

* Combine get_context and set_context into one flag

* Remove unnecessary changes in the Operation enum

* Apply comment

* Patched plonky2 to use a patch for eth_trie_utils

* Implement receipts and logs

Co-authored-by: Hamy Ratoanina <hamy.ratoanina@toposware.com>
Co-authored-by: Linda Guiga <lindaguiga3@gmail.com>

* Cleanup

* Fix tests and address comments

* Change receipts_trie in basic_smart_contract and self_balance_gas_cost

* Cleanup

* Clippy

* Made `PublicValues` serializable

- Needed by the prover scheduler.

* make generate partial_witness pub

* Update range from ReceiptTrie PR

* fix: constrain higher bits of reg_preimage

* Keccak STARK: constraint preimage to equal A on first round

* Constrain next row's stack length

* Add missing links between public values

* Implement receipts of types 1 and 2

* Apply comments

* Fix comment in `proof.rs`

* Apply comments

* Replace genesis state trie check with TODO

* feat: serde for targets

* Display actual trace lengths instead of number of ops

* Remove duplicate code

* Remove filter column for KeccakStark

* Added mock feature flag and test

* remove spurious

* Add blockhash sys opcode

* Apply comments

* Change h256_ulimbs

* Fix overflow check and test. Remove [..8] when using h256_limbs.

* Clippy

* Fix memop reads, from_prover_inputs and cleanup.

* Fix Clippy

* Removed mock feature flag and added mock_build

* clippy

* Now builds on the latest nightly

* Also included clippy fixes introduced by new nightly

* Apply Nick's comment

* Apply Nick's comment

* Now refers to sub-crates using paths (and removed `patch` section)

- Previously refered to specific `crates.io` versions.
- Motivation for this is to allow external projects to be able use
  specific revisions of this repo. Without this, a `[patch]` section
  is almost always required in the external project in order to force
  the internal plonky2 sub-crates to the same version, an approach which
  comes with its own issues.

* Fixes

* clippy

* Made visibilities outside of crate to allow for forking partial witness gen outside of crate

* latest nightly in CI and rust-toolchain

* suppress incorrect Clippy error

* fmt

* clippy suggestions

* clippy suggestions

* clippy suggestions

* clippy suggestions

* clippy suggestions

* more clippy suggestions

* Move byte packing / unpacking to a distinct table (0xPolygonZero#1212)

* Duplicate Memory trace into BytePacking one

* Add mload_32bytes instruction

* Use dedicated ops for byte packing trace

* Change witness generation to reduce memory reads for MLOAD_32BYTES

* Remove segments

* Fix stack

* Fix extra product when fixing CTL for byte_packing

* Write output value in trace

* Add constraints for BYTE_PACKING table

* Add recursive constraints for BYTE_PACKING table

* Fix constraints

* Add address in trace and constraints

* Add timestamp and batch inputs into BytePackingOp struct

* Add extra column

* Fix BytePackingStark CTL

* Tiny fix in witness generation

* Fix the Memory CTL

* Add constraints for the new columns

* Remove 1 column

* Remove limb columns

* Fix

* Fix recursive circuit of BytePackingTable

* Fix constraints

* Fix endianness

* Add MSTORE_32BYTES instruction and move decomposition to packing table

* Add missing constraint

* Add range-check for all bytes

* Add extra constraint

* Cleanup

* Remove REMAINING_LEN column

* Add corresponding implementations in interpreter

* Fix recursive version

* Remove debug assertion because of CI

* Remove FILTER column

* Update new test from rebasing

* Reorder STARK modules to match TraceCheckPoint ordering

* Address comments

* Pacify clippy

* Add documentation to the packing module

* Fix doctest

* Swap ordering in stack macro (0xPolygonZero#1230)

* Swap ordering in stack macro

* Update comment

* Fix self_balance_gas_cost and basic_smart_contract. (0xPolygonZero#1227)

* Fix self_balance_gas_cost and basic_smart_contract.

* Fix Clippy

* Combine arithmetic flags on the CPU side (0xPolygonZero#1187)

* Combine FP254 flags

* Combine basic binary ops together and do CTL with opcode value

* Combine ternary ops together

* Combine MUL DIV and MOD

* Combine shift operations

* Combine byte with other binary ops

* Fix tests

* Clean leftover comment

* Update from latest main

* Put the 'is_simulated' flag inside the Operation enum

* Cleaner way to handle "simulated" operations SHL and SHR.

* Fix comments.

* Minor: suggestion for re-expressing `combined_ops`.

* Update comment

---------

Co-authored-by: Hamish Ivey-Law <hamish@ivey-law.name>

* Remove redundant Keccak sponge cols (0xPolygonZero#1233)

* Rename columns in KeccakSponge for clarity

* Remove redundant columns

* Apply comments

* Combine mstore_general and mload_general into one flag (0xPolygonZero#1188)

* Combine mstore_general and mload_general into one flag

* Add comments and make stack constraints cleaner.

* Fix number of native instructions

* Ordering

* Cleanup

* Update calls to stack eval from latest main

---------

Co-authored-by: Robin Salen <salenrobin@gmail.com>

---------

Co-authored-by: Dimo99 <dimodimov1999@gmail.com>
Co-authored-by: Hamish Ivey-Law <426294+unzvfu@users.noreply.github.com>
Co-authored-by: Robin Salen <salenrobin@gmail.com>
Co-authored-by: Robin Salen <30937548+Nashtare@users.noreply.github.com>
Co-authored-by: Jacqueline Nabaglo <jakub@mirprotocol.org>
Co-authored-by: Nicholas Ward <npward@berkeley.edu>
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: BGluth <gluthb@gmail.com>
Co-authored-by: Linda Guiga <101227802+LindaGuiga@users.noreply.github.com>
Co-authored-by: John Guibas <john@succinct.xyz>
Co-authored-by: Daniel Lubarov <daniel@lubarov.com>
Co-authored-by: Ayush Shukla <shuklaayush247@gmail.com>
Co-authored-by: Uma Roy <uma.roy.us@gmail.com>
Co-authored-by: Hamish Ivey-Law <hamish@ivey-law.name>
sai-deng pushed a commit to 0xmozak/plonky2 that referenced this pull request Jul 18, 2024
* Make GateRef value public

* Better document constraints on addcy carries (0xPolygonZero#1139)

* Add missing constraints on addcy carries.

* Remove bit-checks; make documentation clearer.

* Constrain keccak general

* Reuse set_public_value_targets

* Fix endianness in benefiary limbs

* Convert to u32 instead of u64

* Clippy

* Silence Poseidon warnings for ARM targets

* Remove unused attributes

* Fix trait import. (0xPolygonZero#1163)

* Error instead of panicking for missing preprocessed circuits (0xPolygonZero#1159)

* Set exception flag to 1.

* Connect public values in aggregation circuit (0xPolygonZero#1169)

* Connect public values in aggregation circuit

* Minor

* Write trie roots to memory before kernel bootstrapping  (0xPolygonZero#1172)

* Write trie roots

* Remove CPU trace length

* Update hash_initial/final_tries

* Fix tests

* Minor

* PR feedback

* Connect SHL/SHR operations to the Arithmetic table (0xPolygonZero#1166)

* Add corresponding arithmetic operations to shift ones

* Include SHL/SHR in the arithmetic CTL

* Prevent overflow

* Expand documentation for ctl_data_ternops()

---------

Co-authored-by: Dimo99 <dimodimov1999@gmail.com>
Co-authored-by: Hamish Ivey-Law <426294+unzvfu@users.noreply.github.com>
Co-authored-by: Robin Salen <salenrobin@gmail.com>
Co-authored-by: Robin Salen <30937548+Nashtare@users.noreply.github.com>
Co-authored-by: Jacqueline Nabaglo <jakub@mirprotocol.org>
Co-authored-by: Nicholas Ward <npward@berkeley.edu>
Co-authored-by: Linda Guiga <lindaguiga3@gmail.com>
Co-authored-by: wborgeaud <williamborgeaud@gmail.com>
sai-deng pushed a commit to 0xmozak/plonky2 that referenced this pull request Jul 18, 2024
* Make GateRef value public

* Better document constraints on addcy carries (0xPolygonZero#1139)

* Add missing constraints on addcy carries.

* Remove bit-checks; make documentation clearer.

* Constrain keccak general

* Reuse set_public_value_targets

* Fix endianness in benefiary limbs

* Convert to u32 instead of u64

* Clippy

* Silence Poseidon warnings for ARM targets

* Remove unused attributes

* Fix trait import. (0xPolygonZero#1163)

* Error instead of panicking for missing preprocessed circuits (0xPolygonZero#1159)

* Set exception flag to 1.

* Connect public values in aggregation circuit (0xPolygonZero#1169)

* Connect public values in aggregation circuit

* Minor

* Write trie roots to memory before kernel bootstrapping  (0xPolygonZero#1172)

* Write trie roots

* Remove CPU trace length

* Update hash_initial/final_tries

* Fix tests

* Minor

* PR feedback

* Connect SHL/SHR operations to the Arithmetic table (0xPolygonZero#1166)

* Add corresponding arithmetic operations to shift ones

* Include SHL/SHR in the arithmetic CTL

* Prevent overflow

* Expand documentation for ctl_data_ternops()

* Combine AND and OR flags in CpuStark

* Reduce reallocations

* Address review

* Apply Nicholas comment

* Revert changes in cyclic_subgroup_unknown_order

* Fix logic CTL

* Combine all logic flags together

* Comment

* Combine EQ and ISZERO flags

* Combine jump flags

* Add guidance for external contributors to README.md

* Use Keccak config in simple tests

* Remove is_cpu_cycle

* Remove is_bootstrap_kernel column

* Implement inverse from Fermat little theorem (0xPolygonZero#1176)

* Add inverse from Fermat little theorem

* Remove inlining for goldilocks try_inverse method

* Remove copy on write for mpt_insert and mpt_delete

* Combine a few constraints

* Reduce overconstraining in decode module

* Remove filtering in membus

* Observe public values

* Update tests to have a blockgaslimit fitting u32s

* Update BlockBaseFee to fit in 2 limbs

* Refactor

* Apply comment

* Combine get_context and set_context into one flag

* Remove unnecessary changes in the Operation enum

* Apply comment

* Patched plonky2 to use a patch for eth_trie_utils

* Implement receipts and logs

Co-authored-by: Hamy Ratoanina <hamy.ratoanina@toposware.com>
Co-authored-by: Linda Guiga <lindaguiga3@gmail.com>

* Cleanup

* Fix tests and address comments

* Change receipts_trie in basic_smart_contract and self_balance_gas_cost

* Cleanup

* Clippy

* Made `PublicValues` serializable

- Needed by the prover scheduler.

* make generate partial_witness pub

* Update range from ReceiptTrie PR

* fix: constrain higher bits of reg_preimage

* Keccak STARK: constraint preimage to equal A on first round

* Constrain next row's stack length

* Add missing links between public values

* Implement receipts of types 1 and 2

* Apply comments

* Fix comment in `proof.rs`

* Apply comments

* Replace genesis state trie check with TODO

* feat: serde for targets

* Display actual trace lengths instead of number of ops

* Remove duplicate code

* Remove filter column for KeccakStark

* Added mock feature flag and test

* remove spurious

* Add blockhash sys opcode

* Apply comments

* Change h256_ulimbs

* Fix overflow check and test. Remove [..8] when using h256_limbs.

* Clippy

* Fix memop reads, from_prover_inputs and cleanup.

* Fix Clippy

* Removed mock feature flag and added mock_build

* clippy

* Now builds on the latest nightly

* Also included clippy fixes introduced by new nightly

* Apply Nick's comment

* Apply Nick's comment

* Now refers to sub-crates using paths (and removed `patch` section)

- Previously refered to specific `crates.io` versions.
- Motivation for this is to allow external projects to be able use
  specific revisions of this repo. Without this, a `[patch]` section
  is almost always required in the external project in order to force
  the internal plonky2 sub-crates to the same version, an approach which
  comes with its own issues.

* Fixes

* clippy

* Made visibilities outside of crate to allow for forking partial witness gen outside of crate

* latest nightly in CI and rust-toolchain

* suppress incorrect Clippy error

* fmt

* clippy suggestions

* clippy suggestions

* clippy suggestions

* clippy suggestions

* clippy suggestions

* more clippy suggestions

* Move byte packing / unpacking to a distinct table (0xPolygonZero#1212)

* Duplicate Memory trace into BytePacking one

* Add mload_32bytes instruction

* Use dedicated ops for byte packing trace

* Change witness generation to reduce memory reads for MLOAD_32BYTES

* Remove segments

* Fix stack

* Fix extra product when fixing CTL for byte_packing

* Write output value in trace

* Add constraints for BYTE_PACKING table

* Add recursive constraints for BYTE_PACKING table

* Fix constraints

* Add address in trace and constraints

* Add timestamp and batch inputs into BytePackingOp struct

* Add extra column

* Fix BytePackingStark CTL

* Tiny fix in witness generation

* Fix the Memory CTL

* Add constraints for the new columns

* Remove 1 column

* Remove limb columns

* Fix

* Fix recursive circuit of BytePackingTable

* Fix constraints

* Fix endianness

* Add MSTORE_32BYTES instruction and move decomposition to packing table

* Add missing constraint

* Add range-check for all bytes

* Add extra constraint

* Cleanup

* Remove REMAINING_LEN column

* Add corresponding implementations in interpreter

* Fix recursive version

* Remove debug assertion because of CI

* Remove FILTER column

* Update new test from rebasing

* Reorder STARK modules to match TraceCheckPoint ordering

* Address comments

* Pacify clippy

* Add documentation to the packing module

* Fix doctest

* Swap ordering in stack macro (0xPolygonZero#1230)

* Swap ordering in stack macro

* Update comment

* Fix self_balance_gas_cost and basic_smart_contract. (0xPolygonZero#1227)

* Fix self_balance_gas_cost and basic_smart_contract.

* Fix Clippy

* Combine arithmetic flags on the CPU side (0xPolygonZero#1187)

* Combine FP254 flags

* Combine basic binary ops together and do CTL with opcode value

* Combine ternary ops together

* Combine MUL DIV and MOD

* Combine shift operations

* Combine byte with other binary ops

* Fix tests

* Clean leftover comment

* Update from latest main

* Put the 'is_simulated' flag inside the Operation enum

* Cleaner way to handle "simulated" operations SHL and SHR.

* Fix comments.

* Minor: suggestion for re-expressing `combined_ops`.

* Update comment

---------

Co-authored-by: Hamish Ivey-Law <hamish@ivey-law.name>

* Remove redundant Keccak sponge cols (0xPolygonZero#1233)

* Rename columns in KeccakSponge for clarity

* Remove redundant columns

* Apply comments

* Combine mstore_general and mload_general into one flag (0xPolygonZero#1188)

* Combine mstore_general and mload_general into one flag

* Add comments and make stack constraints cleaner.

* Fix number of native instructions

* Ordering

* Cleanup

* Update calls to stack eval from latest main

---------

Co-authored-by: Robin Salen <salenrobin@gmail.com>

---------

Co-authored-by: Dimo99 <dimodimov1999@gmail.com>
Co-authored-by: Hamish Ivey-Law <426294+unzvfu@users.noreply.github.com>
Co-authored-by: Robin Salen <salenrobin@gmail.com>
Co-authored-by: Robin Salen <30937548+Nashtare@users.noreply.github.com>
Co-authored-by: Jacqueline Nabaglo <jakub@mirprotocol.org>
Co-authored-by: Nicholas Ward <npward@berkeley.edu>
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: BGluth <gluthb@gmail.com>
Co-authored-by: Linda Guiga <101227802+LindaGuiga@users.noreply.github.com>
Co-authored-by: John Guibas <john@succinct.xyz>
Co-authored-by: Daniel Lubarov <daniel@lubarov.com>
Co-authored-by: Ayush Shukla <shuklaayush247@gmail.com>
Co-authored-by: Uma Roy <uma.roy.us@gmail.com>
Co-authored-by: Hamish Ivey-Law <hamish@ivey-law.name>
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.

2 participants