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

Increase EVM Max Gas Limit #236

Merged
merged 3 commits into from
Jul 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
10 changes: 5 additions & 5 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[workspace.package]
version = "0.3.3"
version = "0.3.4"
authors = ["Webb Technologies Inc."]
edition = "2021"
license = "Unlicense"
Expand Down
30 changes: 30 additions & 0 deletions standalone/node/src/chain_spec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -677,6 +677,36 @@ fn testnet_genesis(
code: vec![0x00],
},
);
map.insert(
H160::from_str("46Bf9B20A8144BaA7C2BB76303b6a17eB8755408")
.expect("internal H160 is valid; qed"),
fp_evm::GenesisAccount {
nonce: U256::from(1),
balance: U256::from(1_000_000_000_000_000_000_000_000u128),
storage: Default::default(),
code: vec![0x00],
},
);
map.insert(
H160::from_str("bFAc59575FeC3d1b33C7685eE6b3a2BfC155bdF3")
.expect("internal H160 is valid; qed"),
fp_evm::GenesisAccount {
nonce: U256::from(1),
balance: U256::from(1_000_000_000_000_000_000_000_000u128),
storage: Default::default(),
code: vec![0x00],
},
);
map.insert(
H160::from_str("c65351122A5dc7881559DeE52e025678212C615C")
.expect("internal H160 is valid; qed"),
fp_evm::GenesisAccount {
nonce: U256::from(1),
balance: U256::from(1_000_000_000_000_000_000_000_000u128),
storage: Default::default(),
code: vec![0x00],
},
);
map.insert(
H160::from_str("2ecceed83d6d2908cf4d67c76984e0bbcbfebbc1")
.expect("internal H160 is valid; qed"),
Expand Down
12 changes: 6 additions & 6 deletions standalone/node/src/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,15 +51,15 @@ impl SubstrateCli for Cli {

fn load_spec(&self, id: &str) -> Result<Box<dyn sc_service::ChainSpec>, String> {
Ok(match id {
"dev" => Box::new(chain_spec::development_config(3884533460)?),
"relayer" => Box::new(chain_spec::relayer_testnet_config(3884533460)?),
"" | "local" => Box::new(chain_spec::local_testnet_config(3884533460)?),
"dev" => Box::new(chain_spec::development_config(4006)?),
"relayer" => Box::new(chain_spec::relayer_testnet_config(4006)?),
"" | "local" => Box::new(chain_spec::local_testnet_config(4006)?),
// generates the standalone spec for testing locally
"standalone-local" => Box::new(chain_spec::standalone_local_config(3884533460)?),
"standalone-local" => Box::new(chain_spec::standalone_local_config(4006)?),
// generates the standalone spec for testnet
"standalone-alpha" => Box::new(chain_spec::standalone_testnet_config(3884533460)?),
"standalone-alpha" => Box::new(chain_spec::standalone_testnet_config(4006)?),
// generates the standalone spec for longterm testnet
"standalone" => Box::new(chain_spec::standalone_live_config(3884533460)?),
"standalone" => Box::new(chain_spec::standalone_live_config(4006)?),
path =>
Box::new(chain_spec::ChainSpec::from_json_file(std::path::PathBuf::from(path))?),
})
Expand Down
4 changes: 1 addition & 3 deletions standalone/runtime/src/frontier_evm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,7 @@ impl pallet_evm_precompile_proxy::EvmProxyCallFilter for ProxyType {

/// Current approximation of the gas/s consumption considering
/// EVM execution over compiled WASM (on 4.4Ghz CPU).
/// Given the 500ms Weight, from which 75% only are used for transactions,
/// the total EVM execution gas limit is: GAS_PER_SECOND * 0.500 * 0.75 ~= 15_000_000.
pub const GAS_PER_SECOND: u64 = 40_000_000;
pub const GAS_PER_SECOND: u64 = 400_000_000;

/// Approximate ratio of the amount of Weight per Gas.
/// u64 works for approximations because Weight is a very small unit compared to gas.
Expand Down
6 changes: 3 additions & 3 deletions standalone/runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
spec_name: create_runtime_str!("tangle-standalone"),
impl_name: create_runtime_str!("tangle-standalone"),
authoring_version: 1,
spec_version: 303, // v0.3.3
spec_version: 304, // v0.3.4
impl_version: 1,
apis: RUNTIME_API_VERSIONS,
transaction_version: 1,
Expand All @@ -134,8 +134,8 @@ pub fn native_version() -> NativeVersion {
NativeVersion { runtime_version: VERSION, can_author_with: Default::default() }
}

/// We allow for 2000ms of compute with a 6 second average block time.
pub const WEIGHT_MILLISECS_PER_BLOCK: u64 = 2000;
/// We allow for 2500ms of compute with a 6 second average block time.
pub const WEIGHT_MILLISECS_PER_BLOCK: u64 = 2500;
pub const MAXIMUM_BLOCK_WEIGHT: Weight =
Weight::from_parts(WEIGHT_MILLISECS_PER_BLOCK * WEIGHT_REF_TIME_PER_MILLIS, u64::MAX);
pub const MAXIMUM_BLOCK_LENGTH: u32 = 5 * 1024 * 1024;
Expand Down