This repository was archived by the owner on Apr 18, 2025. It is now read-only.
forked from privacy-ethereum/zkevm-circuits
-
Notifications
You must be signed in to change notification settings - Fork 387
(WIP) feat: add sload op
#79
Closed
Closed
Changes from all commits
Commits
Show all changes
92 commits
Select commit
Hold shift + click to select a range
8dff730
init
0xmountaintop 45a2c19
cargo fmt
0xmountaintop 6477034
fix state_write_with_reversion
0xmountaintop 32684d8
fix table_assignment
0xmountaintop f77d2fc
Merge branch 'main' into rw_table/add_aux
0xmountaintop cad509d
add sload
0xmountaintop 78fb7b0
init test sload_gadget
0xmountaintop 7e173a3
fix storage_slot_access_list_write_with_reversion
0xmountaintop 939db3a
fix
0xmountaintop 930175f
update TODOs
0xmountaintop f674018
update
0xmountaintop c262711
cargo clippy
0xmountaintop da4021e
rename
0xmountaintop 34afaac
WIP
0xmountaintop cb3c4e1
WIP
0xmountaintop 0e05132
WIP
0xmountaintop 8ca2ba9
WIP
0xmountaintop e8023e5
ojbk
0xmountaintop 325f7cc
minor
0xmountaintop 68549c2
WIP
0xmountaintop e230906
add
0xmountaintop f3fad86
update
0xmountaintop 618811c
go go go
0xmountaintop c1d8218
clean up
0xmountaintop 243e469
improve
0xmountaintop 9622354
cargo fmt
0xmountaintop c7e2ee7
up up up
0xmountaintop 1f283ba
Merge branch 'main' into rw_table/add_aux
0xmountaintop f01a41a
Merge branch 'rw_table/add_aux' into rework/storage
0xmountaintop 5d87ec8
minor
0xmountaintop 139ae6f
minor
0xmountaintop fdbbfdb
add aux
0xmountaintop 70096e5
init tx_access_list
0xmountaintop 39b68bd
Merge branch 'main' into rework/storage
0xmountaintop f3e499b
merge
0xmountaintop f399922
fix
0xmountaintop 9da4e43
cargo fmt
0xmountaintop 45ae07b
fix
0xmountaintop 2828faa
minor
0xmountaintop ca6774a
WIP
0xmountaintop c6bec89
update step_convert
0xmountaintop 2d6c3bb
cargo fmt
0xmountaintop 85167a4
fix assign_exec_step
0xmountaintop 53b3393
WIP
0xmountaintop d72ccd4
fix
0xmountaintop 87ccaff
mark
0xmountaintop e56d77d
Debug (#91)
0xmountaintop 7b5099a
init mock test_ok
0xmountaintop 49626fb
update ExecStep
0xmountaintop 3b34151
update
0xmountaintop 01f1b54
minor
0xmountaintop 682b640
fix
0xmountaintop 35bc2b5
cargo fmt
0xmountaintop e33d25a
update
0xmountaintop 7dd6872
update
0xmountaintop 0566846
update
0xmountaintop da15d1a
update
0xmountaintop a737290
fix
0xmountaintop d074452
update
0xmountaintop cdf71d5
update
0xmountaintop 933cdf8
finish
0xmountaintop e29d590
???
0xmountaintop 7404ed6
fix
0xmountaintop 22f7339
fix
0xmountaintop 837bc31
fix
0xmountaintop 8f271c2
minor
0xmountaintop 0d7c4fd
minor
0xmountaintop 11174fb
minor
0xmountaintop 5543804
minor
0xmountaintop b64b1eb
fix tx_id
0xmountaintop 4b32546
fix is_persistent
0xmountaintop 2afe61b
fix rw_counter_end_of_reversion
0xmountaintop cf4742e
minor
0xmountaintop 33db661
???
0xmountaintop 98b1e9e
fix call_id
0xmountaintop 11a3e37
minor
0xmountaintop 4767fd4
committed_value
0xmountaintop 867d7a0
rename
0xmountaintop 2575139
rename
0xmountaintop 32fc76a
update
0xmountaintop 33d255b
only write
0xmountaintop f1e533c
change lookup for CalleeAddress from TxContextLookup to CallContextLo…
0xmountaintop c830cc5
minor
0xmountaintop 1363d77
minor
0xmountaintop 268807f
clean up tests
0xmountaintop 5fdefcd
WIP
0xmountaintop 13422f7
minor
0xmountaintop 5926b5b
clean up
0xmountaintop 3f5cccd
deal with address
0xmountaintop 9bc7c6b
fix
0xmountaintop 4eb2ff1
clean up
0xmountaintop ee2e2a7
fix
0xmountaintop File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -414,6 +414,8 @@ impl Op for TxAccessListAccountOp { | |
| /// `SLOAD` step of the [`ExecStep`](crate::circuit_input_builder::ExecStep). | ||
| #[derive(Clone, PartialEq, Eq)] | ||
| pub struct TxAccessListAccountStorageOp { | ||
| /// RW | ||
|
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. revert this file |
||
| pub rw: RW, | ||
| /// Transaction ID: Transaction index in the block starting at 1. | ||
| pub tx_id: usize, | ||
| /// Account Address | ||
|
|
@@ -426,6 +428,64 @@ pub struct TxAccessListAccountStorageOp { | |
| pub value_prev: bool, | ||
| } | ||
|
|
||
| impl TxAccessListAccountStorageOp { | ||
| /// Create a new instance of a `TxAccessListAccountStorageOp` from it's | ||
| /// components. | ||
| pub fn new( | ||
| rw: RW, | ||
| tx_id: usize, | ||
| address: Address, | ||
| key: Word, | ||
| value: bool, | ||
| value_prev: bool, | ||
| ) -> TxAccessListAccountStorageOp { | ||
| TxAccessListAccountStorageOp { | ||
| rw, | ||
| tx_id, | ||
| address, | ||
| key, | ||
| value, | ||
| value_prev, | ||
| } | ||
| } | ||
|
|
||
| /// Returns the internal [`RW`] which says whether the operation corresponds | ||
| /// to a Read or a Write into storage_slot access_list. | ||
| pub const fn rw(&self) -> RW { | ||
| self.rw | ||
| } | ||
|
|
||
| /// Returns the [`Target`] (operation type) of this operation. | ||
| pub const fn target(&self) -> Target { | ||
| Target::TxAccessListAccountStorage | ||
| } | ||
|
|
||
| /// Returns the [`TxID`] corresponding to this operation. | ||
| pub const fn tx_id(&self) -> usize { | ||
| self.tx_id | ||
| } | ||
|
|
||
| /// Returns the [`Address`] corresponding to this operation. | ||
| pub const fn address(&self) -> &Address { | ||
| &self.address | ||
| } | ||
|
|
||
| /// Returns the [`Word`] used as key for this operation. | ||
| pub const fn key(&self) -> &Word { | ||
| &self.key | ||
| } | ||
|
|
||
| /// Returns the [`bool`] read or written by this operation. | ||
| pub const fn value(&self) -> bool { | ||
| self.value | ||
| } | ||
|
|
||
| /// Returns the [`bool`] at key found previous to this operation. | ||
| pub const fn value_prev(&self) -> bool { | ||
| self.value_prev | ||
| } | ||
| } | ||
|
|
||
| impl fmt::Debug for TxAccessListAccountStorageOp { | ||
| fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { | ||
| f.write_str("TxAccessListAccountStorageOp { ")?; | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -121,6 +121,16 @@ impl OperationContainer { | |
| pub fn sorted_storage(&self) -> Vec<Operation<StorageOp>> { | ||
| self.storage.iter().sorted().cloned().collect() | ||
| } | ||
|
|
||
|
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. revert this file |
||
| /// Returns a sorted vector of all of the [`TxAccessListAccountStorageOp`]s | ||
| /// contained inside of the container. | ||
| pub fn sorted_txaccesslist_storage(&self) -> Vec<Operation<TxAccessListAccountStorageOp>> { | ||
| self.tx_access_list_storage_slot | ||
| .iter() | ||
| .sorted() | ||
| .cloned() | ||
| .collect() | ||
| } | ||
| } | ||
|
|
||
| #[cfg(test)] | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| mod sload; | ||
|
|
||
| pub(crate) use sload::SloadGadget; |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
revert this file