Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

Commit

Permalink
EIP 2028: transaction gas lowered from 68 to 16 (#10987)
Browse files Browse the repository at this point in the history
  • Loading branch information
dvdplm authored and s3krit committed Sep 5, 2019
1 parent 4d6c80c commit 5d2d90a
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 2 deletions.
1 change: 0 additions & 1 deletion ethcore/evm/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,6 @@ fn test_calldataload(factory: super::Factory) {

assert_eq!(gas_left, U256::from(79_991));
assert_store(&ext, 0, "23ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff23");

}

evm_test!{test_author: test_author_int}
Expand Down
9 changes: 8 additions & 1 deletion ethcore/vm/src/schedule.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ pub struct Schedule {
pub tx_create_gas: usize,
/// Additional cost for empty data transaction
pub tx_data_zero_gas: usize,
/// Aditional cost for non-empty data transaction
/// Additional cost for non-empty data transaction
pub tx_data_non_zero_gas: usize,
/// Gas price for copying memory
pub copy_gas: usize,
Expand Down Expand Up @@ -275,6 +275,13 @@ impl Schedule {
schedule
}

/// Schedule for the Istanbul fork of the Ethereum main net.
pub fn new_istanbul() -> Schedule {
let mut schedule = Self::new_constantinople();
schedule.tx_data_non_zero_gas = 16;
schedule
}

fn new(efcd: bool, hdc: bool, tcg: usize) -> Schedule {
Schedule {
exceptional_failed_code_deposit: efcd,
Expand Down
7 changes: 7 additions & 0 deletions ethcore/vm/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,13 @@ impl FakeExt {
ext
}

/// New fake externalities with constantinople schedule rules
pub fn new_istanbul() -> Self {
let mut ext = FakeExt::default();
ext.schedule = Schedule::new_istanbul();
ext
}

/// Alter fake externalities to allow wasm
pub fn with_wasm(mut self) -> Self {
self.schedule.wasm = Some(Default::default());
Expand Down
2 changes: 2 additions & 0 deletions json/src/spec/params.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,8 @@ pub struct Params {
/// See `CommonParams` docs.
pub eip1014_transition: Option<Uint>,
/// See `CommonParams` docs.
pub eip2028_transition: Option<Uint>,
/// See `CommonParams` docs.
pub dust_protection_transition: Option<Uint>,
/// See `CommonParams` docs.
pub nonce_cap_increment: Option<Uint>,
Expand Down

0 comments on commit 5d2d90a

Please sign in to comment.