Skip to content
This repository was archived by the owner on Apr 18, 2025. It is now read-only.

Tx refund #109

Closed
wants to merge 80 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
80 commits
Select commit Hold shift + click to select a range
f00aaee
update
0xmountaintop Feb 13, 2022
afcde83
fix clippy
0xmountaintop Feb 13, 2022
20de4a7
clean up
0xmountaintop Feb 13, 2022
ef434f4
cargo fmt
0xmountaintop Feb 13, 2022
958aa40
cargo clippy
0xmountaintop Feb 13, 2022
29a59f9
minor
0xmountaintop Feb 14, 2022
45e18fc
Merge remote-tracking branch 'origin/main' into re-init
0xmountaintop Feb 15, 2022
8c3987c
Merge branch 'main' into re-init
0xmountaintop Feb 17, 2022
3e1aaa0
merge with master
0xmountaintop Feb 21, 2022
6e7e4d2
Merge remote-tracking branch 'origin/main' into re-init
0xmountaintop Feb 21, 2022
6555051
minor
0xmountaintop Feb 21, 2022
8541fe9
cargo fmt
0xmountaintop Feb 21, 2022
9a53e70
add more to StorageOp
0xmountaintop Feb 21, 2022
a438997
skip for now
0xmountaintop Feb 21, 2022
167b1c3
cargo fmt
0xmountaintop Feb 21, 2022
2473e5b
minor
0xmountaintop Feb 21, 2022
e087cf9
minor
0xmountaintop Feb 21, 2022
43bee1e
minor
0xmountaintop Feb 21, 2022
191c86f
minor
0xmountaintop Feb 21, 2022
5250724
minor
0xmountaintop Feb 21, 2022
bb21899
minor
0xmountaintop Feb 21, 2022
c14aa07
minor
0xmountaintop Feb 22, 2022
69a97a0
minor
0xmountaintop Feb 22, 2022
d0c03a0
update
0xmountaintop Feb 22, 2022
be6fe59
fix
0xmountaintop Feb 22, 2022
d4de9bd
cargo fmt
0xmountaintop Feb 22, 2022
bf79194
cargo clippy
0xmountaintop Feb 22, 2022
f8c7887
update
0xmountaintop Feb 23, 2022
350d881
Merge remote-tracking branch 'origin/main' into deal_with_call_context
0xmountaintop Feb 23, 2022
2283e97
fix
0xmountaintop Feb 23, 2022
58b80a0
Merge branch 'main' into re-init
0xmountaintop Feb 24, 2022
6f978b9
merge and fix conflicts
0xmountaintop Feb 25, 2022
d1babf3
Merge branch 'main' into re-init
0xmountaintop Feb 27, 2022
ecaac3d
merge and fix conflicts
0xmountaintop Feb 27, 2022
3d44162
update eth-types/src/evm_types.rs
0xmountaintop Feb 27, 2022
29f0ff9
update zkevm-circuits/src/evm_circuit/execution.rs
0xmountaintop Feb 27, 2022
a6de489
update zkevm-circuits/src/evm_circuit/execution/storage.rs
0xmountaintop Feb 27, 2022
652da71
update zkevm-circuits/src/evm_circuit/witness.rs
0xmountaintop Feb 27, 2022
71b3874
update zkevm-circuits/src/evm_circuit/util/constraint_builder.rs
0xmountaintop Feb 27, 2022
2837d40
update zkevm-circuits/src/evm_circuit/execution/storage/sstore.rs
0xmountaintop Feb 27, 2022
501c868
update
0xmountaintop Feb 27, 2022
4b1edea
fix zkevm-circuits/src/evm_circuit/witness.rs
0xmountaintop Feb 27, 2022
5c00a90
implement gas (#108)
0xmountaintop Feb 27, 2022
7eb8525
minor
0xmountaintop Feb 27, 2022
74c8b7b
init tx_refund
0xmountaintop Feb 27, 2022
c04550b
minor
0xmountaintop Feb 27, 2022
bb6a302
minor
0xmountaintop Feb 27, 2022
b5cf7bd
minor
0xmountaintop Feb 27, 2022
a7d5900
minor
0xmountaintop Feb 27, 2022
55f50e8
minor
0xmountaintop Feb 27, 2022
f51c251
fix
0xmountaintop Feb 27, 2022
612a21a
minor
0xmountaintop Feb 27, 2022
5f1757d
update
0xmountaintop Feb 27, 2022
57a2349
update
0xmountaintop Feb 27, 2022
644184b
mei shuo jiu shi ling ka
0xmountaintop Feb 27, 2022
48982e1
mei shuo jiu shi ling ka
0xmountaintop Feb 27, 2022
bd6e53a
update
0xmountaintop Feb 27, 2022
89ca6f9
update
0xmountaintop Feb 27, 2022
00df033
update
0xmountaintop Feb 27, 2022
758449d
update
0xmountaintop Feb 27, 2022
c9f6765
update
0xmountaintop Feb 27, 2022
d0708b8
finish
0xmountaintop Feb 27, 2022
075f8f1
cargo fmt
0xmountaintop Feb 27, 2022
9f627db
update test cases
0xmountaintop Feb 28, 2022
96cf985
Merge branch 're-init-sstore' into tx_refund
0xmountaintop Feb 28, 2022
8fc948f
fix
0xmountaintop Mar 7, 2022
8cc869c
Rw::TxFund::Value changed from Word to Cell; fixed sstore tests
lispc Mar 8, 2022
0552cd9
cargo clippy
0xmountaintop Mar 9, 2022
a2b6866
roll back to degree=15
0xmountaintop Mar 9, 2022
f3bbc8b
minor
0xmountaintop Mar 9, 2022
0e60d4c
merge
0xmountaintop Mar 9, 2022
e3e4149
use u64 for refund
0xmountaintop Mar 9, 2022
f1e7310
more cell
0xmountaintop Mar 9, 2022
8ae1424
remove call_id cell
0xmountaintop Mar 9, 2022
5bccc6d
minor
0xmountaintop Mar 9, 2022
72d4297
remove is_warm for refund
0xmountaintop Mar 9, 2022
58dd62f
Reduce (#114)
0xmountaintop Mar 9, 2022
0ea9dc6
clean up
0xmountaintop Mar 9, 2022
7966049
update
0xmountaintop Mar 9, 2022
b976049
minor
0xmountaintop Mar 9, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions bus-mapping/src/operation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -482,9 +482,9 @@ pub struct TxRefundOp {
/// Transaction ID: Transaction index in the block starting at 1.
pub tx_id: usize,
/// Refund Value after the operation
pub value: Word,
pub value: u64,
/// Refund Value before the operation
pub value_prev: Word,
pub value_prev: u64,
}

impl fmt::Debug for TxRefundOp {
Expand Down
8 changes: 8 additions & 0 deletions eth-types/src/evm_types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,14 @@ impl GasCost {
pub const COLD_ACCOUNT_ACCESS_COST: Self = Self(2600);
/// Constant cost for a warm storage read
pub const WARM_STORAGE_READ_COST: Self = Self(100);
/// Constant cost for a basic storage operation
pub const SLOAD_GAS: Self = Self(100);
/// Constant cost for a storage set
pub const SSTORE_SET_GAS: Self = Self(20000);
/// Constant cost for a storage reset
pub const SSTORE_RESET_GAS: Self = Self(2900);
/// Constant cost for a storage clear
pub const SSTORE_CLEARS_SCHEDULE: Self = Self(15000);
/// Constant cost for a non-creation transaction
pub const TX: Self = Self(21000);
/// Constant cost for creation transaction
Expand Down
5 changes: 5 additions & 0 deletions zkevm-circuits/src/evm_circuit/execution.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ mod selfbalance;
mod signed_comparator;
mod signextend;
mod sload;
mod sstore;
mod stop;
mod swap;
mod timestamp;
Expand Down Expand Up @@ -75,6 +76,7 @@ use selfbalance::SelfbalanceGadget;
use signed_comparator::SignedComparatorGadget;
use signextend::SignextendGadget;
use sload::SloadGadget;
use sstore::SstoreGadget;
use stop::StopGadget;
use swap::SwapGadget;
use timestamp::TimestampGadget;
Expand Down Expand Up @@ -133,6 +135,7 @@ pub(crate) struct ExecutionConfig<F> {
timestamp_gadget: TimestampGadget<F>,
selfbalance_gadget: SelfbalanceGadget<F>,
sload_gadget: SloadGadget<F>,
sstore_gadget: SstoreGadget<F>,
}

impl<F: Field> ExecutionConfig<F> {
Expand Down Expand Up @@ -268,6 +271,7 @@ impl<F: Field> ExecutionConfig<F> {
coinbase_gadget: configure_gadget!(),
timestamp_gadget: configure_gadget!(),
sload_gadget: configure_gadget!(),
sstore_gadget: configure_gadget!(),
step: step_curr,
presets_map,
};
Expand Down Expand Up @@ -524,6 +528,7 @@ impl<F: Field> ExecutionConfig<F> {
}
ExecutionState::SELFBALANCE => assign_exec_step!(self.selfbalance_gadget),
ExecutionState::SLOAD => assign_exec_step!(self.sload_gadget),
ExecutionState::SSTORE => assign_exec_step!(self.sstore_gadget),
ExecutionState::CALLDATACOPY => {
assign_exec_step!(self.calldatacopy_gadget)
}
Expand Down
Loading