Skip to content

Commit

Permalink
Substrate 8b3e5bc (#318)
Browse files Browse the repository at this point in the history
* Bump substrate to latest of frontier branch (ca63242)

* Bump substrate to version 3.0.0

This also bumps some of frontier's own versions from 2.0.0 to 3.0.0

* Bump sp-consensus from 0.8.0 -> 0.9.0

* Specify parity-scale-codec v2.0.0

* Bump ethereum from v0.6 to v0.7.1

This should resolve the funty/bitcvec compile issues

* Bump evm version 0.23 -> 0.24

* Bump kvdb 0.8.0 -> 0.9.0 and kvdb-rocksdb 0.9.0 -> 0.11.0

* Update use of codec

* Incremental Cargo.lock update

* Bump ethereum-types and primitive-types
ethereum-types 0.10.0 -> 0.11.0
primitive-types 0.8.0 -> 0.9.0

* Reflect BlockBuilderApi changes

* Remove Inherent from Aura pallet

* Point all ethereum to v0.7.1

* Reflect telemetry_span changes and is_network_authority -> is_authority

* fix tests with test palletinfo

* Point new sp- dependencies to substrate 3.0.0

* Reflect parity-scale-codec changes

* Set OnTimestampSet to no-op instead of Aura

* Update Cargo.lock

* Reflect runtime logging refactor

* Use spawn_essential_handle() instead of spawn_handle()

* Point substrate to master/a8c2bc66ea8667a1dcbafa13ce184b020bd6f84b

* Update Cargo.lock

* Remove evm 0.23 entries from Cargo.lock / Cargo.toml

* Cherry-pick 8ea8614 (Use runtime's block gas limit in estimate_gas RPC call)

* Bump substrate a8c2bc6 -> 8a8c2bc

* Remove format! macro call form runtime

* Update Cargo.lock

* Reflect change to RandomnessCollectiveFlip

* Reflect Telemetry refactor

* Remove Option from GenesisConfig

* Incremental WIP refactoring telemetry

* Finish telemetry-related refactor

* Reflect modified error string in unit test

* Use desired substrate branch (frontier) and commit (8b3e5bc)

* Some clean up from telemetry refactor

* Point new Cargo.lock entry to substrate commit 8b3e5bc

* Restore missing comma

* Update Cargo.lock

* Remove ConsensusResult::Aura after merge conflict resolution

* Use substrate master branch temporarily

* Update old version of ethereum-types and parity-scale-codec

* Add default-features in frame/dynamic-fee

* Point substrate to frontier branch @ 8b3e5bc

* Point to evm commit that avoids no_std issue

* Revert "Point to evm commit that avoids no_std issue"

This reverts commit 6f48d043eb20b99b433bf5b9340f49ceb20a2766.

* Bump evm to version 0.25

* Bump CI rust version

* Revert "Bump CI rust version"

This reverts commit 7db02fbb7912554b03b2f8e7a5f74fc1fc415063.

* Use evm v0.25 in new precompile

* Add palletAura and palletGrandpa to test specs

* Revert "Cherry-pick 8ea8614 (Use runtime's block gas limit in estimate_gas RPC call)"

This reverts commit 753cf641d93461daf8c1b957366cc46acc984b0d.
  • Loading branch information
notlesh authored Mar 24, 2021
1 parent 46e5cd4 commit da8f7ba
Show file tree
Hide file tree
Showing 21 changed files with 536 additions and 607 deletions.
885 changes: 373 additions & 512 deletions Cargo.lock

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions frame/dynamic-fee/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ license = "Apache-2.0"
[dependencies]
codec = { package = "parity-scale-codec", version = "2.0.0", default-features = false }
serde = { version = "1.0.101", optional = true }
sp-std = { version = "3.0.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "frontier" }
sp-core = { version = "3.0.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "frontier" }
sp-runtime = { version = "3.0.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "frontier" }
sp-inherents = { version = "3.0.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "frontier" }
sp-std = { version = "3.0.0-dev", default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "frontier" }
sp-core = { version = "3.0.0-dev", default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "frontier" }
sp-runtime = { version = "3.0.0-dev", default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "frontier" }
sp-inherents = { version = "3.0.0-dev", default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "frontier" }
frame-system = { version = "3.0.0-dev", default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "frontier" }
frame-support = { version = "3.0.0-dev", default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "frontier" }

Expand Down
2 changes: 1 addition & 1 deletion frame/ethereum/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ sp-runtime = { version = "3.0.0-dev", default-features = false, git = "https://g
sp-std = { version = "3.0.0-dev", default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "frontier" }
sp-io = { version = "3.0.0-dev", default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "frontier" }
fp-evm = { version = "0.8.0", default-features = false, path = "../../primitives/evm" }
evm = { version = "0.24.0", features = ["with-codec"], default-features = false }
evm = { version = "0.25.0", features = ["with-codec"], default-features = false }
ethereum = { version = "0.7.1", default-features = false, features = ["with-codec"] }
ethereum-types = { version = "0.11", default-features = false }
rlp = { version = "0.5", default-features = false }
Expand Down
6 changes: 3 additions & 3 deletions frame/evm/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ sp-io = { version = "3.0.0", default-features = false, git = "https://github.com
fp-evm = { version = "0.8.0", default-features = false, path = "../../primitives/evm" }
primitive-types = { version = "0.9.0", default-features = false, features = ["rlp", "byteorder"] }
rlp = { version = "0.5", default-features = false }
evm = { version = "0.24.0", default-features = false, features = ["with-codec"] }
evm-runtime = { version = "0.23.0", default-features = false }
evm-gasometer = { version = "0.23.0", default-features = false }
evm = { version = "0.25.0", default-features = false, features = ["with-codec"] }
evm-runtime = { version = "0.25.0", default-features = false }
evm-gasometer = { version = "0.25.0", default-features = false }
sha3 = { version = "0.8", default-features = false }

[features]
Expand Down
2 changes: 1 addition & 1 deletion frame/evm/precompile/blake2/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ description = "BLAKE2 precompiles for EVM pallet."
sp-core = { version = "3.0.0", default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "frontier" }
sp-io = { version = "3.0.0", default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "frontier" }
fp-evm = { version = "0.8.0", default-features = false, path = "../../../../primitives/evm" }
evm = { version = "0.24.0", default-features = false, features = ["with-codec"] }
evm = { version = "0.25.0", default-features = false, features = ["with-codec"] }

[features]
default = ["std"]
Expand Down
2 changes: 1 addition & 1 deletion frame/evm/precompile/bn128/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ description = "BN128 precompiles for EVM pallet."
sp-core = { version = "3.0.0", default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "frontier" }
sp-io = { version = "3.0.0", default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "frontier" }
fp-evm = { version = "0.8.0", default-features = false, path = "../../../../primitives/evm" }
evm = { version = "0.24.0", default-features = false, features = ["with-codec"] }
evm = { version = "0.25.0", default-features = false, features = ["with-codec"] }
bn = { package = "substrate-bn", version = "0.5", default-features = false }

[features]
Expand Down
2 changes: 1 addition & 1 deletion frame/evm/precompile/dispatch/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ sp-io = { version = "3.0.0", default-features = false, git = "https://github.com
frame-support = { version = "3.0.0", default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "frontier" }
pallet-evm = { version = "3.0.0", default-features = false, path = "../.." }
fp-evm = { version = "0.8.0", default-features = false, path = "../../../../primitives/evm" }
evm = { version = "0.24.0", default-features = false, features = ["with-codec"] }
evm = { version = "0.25.0", default-features = false, features = ["with-codec"] }
codec = { package = "parity-scale-codec", version = "2.0.0", default-features = false }

[features]
Expand Down
2 changes: 1 addition & 1 deletion frame/evm/precompile/ed25519/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ description = "ED25519 precompiles for EVM pallet."
sp-core = { version = "3.0.0", default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "frontier" }
sp-io = { version = "3.0.0", default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "frontier" }
fp-evm = { version = "0.8.0", default-features = false, path = "../../../../primitives/evm" }
evm = { version = "0.24.0", default-features = false, features = ["with-codec"] }
evm = { version = "0.25.0", default-features = false, features = ["with-codec"] }
ed25519-dalek = { version = "1.0.0", features = ["alloc", "u64_backend"], default-features = false }

[features]
Expand Down
2 changes: 1 addition & 1 deletion frame/evm/precompile/modexp/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ description = "MODEXP precompiles for EVM pallet."
sp-core = { version = "3.0.0", default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "frontier" }
sp-io = { version = "3.0.0", default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "frontier" }
fp-evm = { version = "0.8.0", default-features = false, path = "../../../../primitives/evm" }
evm = { version = "0.24.0", default-features = false, features = ["with-codec"] }
evm = { version = "0.25.0", default-features = false, features = ["with-codec"] }
num = { version = "0.3", features = ["alloc"], default-features = false }

[dev-dependencies]
Expand Down
5 changes: 2 additions & 3 deletions frame/evm/precompile/modexp/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,7 @@ impl LinearCostPrecompile for Modexp {
// input length should be at least 96 + user-specified length of base + exp + mod
let total_len = base_len + exp_len + mod_len + 96;
if input.len() < total_len {
let err_msg = format!("expected at least {} bytes but received {}", total_len, input.len());
return Err(ExitError::Other(err_msg.into()));
return Err(ExitError::Other("insufficient input size".into()));
}

// Gas formula allows arbitrary large exp_len when base and modulus are empty, so we need to handle empty base first.
Expand Down Expand Up @@ -167,7 +166,7 @@ mod tests {
panic!("Test not expected to pass");
},
Err(e) => {
assert_eq!(e, ExitError::Other("expected at least 99 bytes but received 96".into()));
assert_eq!(e, ExitError::Other("insufficient input size".into()));
Ok(())
}
}
Expand Down
4 changes: 2 additions & 2 deletions frame/evm/precompile/sha3fips/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ description = "SHA3 FIPS202 precompile for EVM pallet."
sp-core = { version = "3.0.0", default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "frontier" }
sp-io = { version = "3.0.0", default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "frontier" }
fp-evm = { version = "0.8.0", default-features = false, path = "../../../../primitives/evm" }
evm = { version = "0.24.0", default-features = false, features = ["with-codec"] }
evm = { version = "0.25.0", default-features = false, features = ["with-codec"] }
tiny-keccak = { version = "2.0", features = ["fips202"] }

[features]
Expand All @@ -22,4 +22,4 @@ std = [
"sp-io/std",
"fp-evm/std",
"evm/std",
]
]
2 changes: 1 addition & 1 deletion frame/evm/precompile/simple/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ description = "Simple precompiles for EVM pallet."
sp-core = { version = "3.0.0", default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "frontier" }
sp-io = { version = "3.0.0", default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "frontier" }
fp-evm = { version = "0.8.0", default-features = false, path = "../../../../primitives/evm" }
evm = { version = "0.24.0", default-features = false, features = ["with-codec"] }
evm = { version = "0.25.0", default-features = false, features = ["with-codec"] }
ripemd160 = { version = "0.9", default-features = false }

[features]
Expand Down
14 changes: 7 additions & 7 deletions frame/evm/src/runner/stack.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ use sp_std::{marker::PhantomData, vec::Vec, boxed::Box, mem, collections::btree_
use sp_core::{U256, H256, H160};
use sp_runtime::traits::UniqueSaturatedInto;
use frame_support::{
debug, ensure, traits::{Get, Currency, ExistenceRequirement},
log, ensure, traits::{Get, Currency, ExistenceRequirement},
storage::{StorageMap, StorageDoubleMap},
};
use sha3::{Keccak256, Digest};
Expand Down Expand Up @@ -93,7 +93,7 @@ impl<T: Config> Runner<T> {

let used_gas = U256::from(executor.used_gas());
let actual_fee = executor.fee(gas_price);
debug::debug!(
log::debug!(
target: "evm",
"Execution {:?} [source: {:?}, value: {}, gas_limit: {}, actual_fee: {}]",
reason,
Expand All @@ -109,7 +109,7 @@ impl<T: Config> Runner<T> {
let state = executor.into_state();

for address in state.substate.deletes {
debug::debug!(
log::debug!(
target: "evm",
"Deleting account at {:?}",
address
Expand All @@ -118,7 +118,7 @@ impl<T: Config> Runner<T> {
}

for log in &state.substate.logs {
debug::trace!(
log::trace!(
target: "evm",
"Inserting log for {:?}, topics ({}) {:?}, data ({}): {:?}]",
log.address,
Expand Down Expand Up @@ -444,15 +444,15 @@ impl<'vicinity, 'config, T: Config> StackStateT<'config> for SubstrateStackState

fn set_storage(&mut self, address: H160, index: H256, value: H256) {
if value == H256::default() {
debug::debug!(
log::debug!(
target: "evm",
"Removing storage for {:?} [index: {:?}]",
address,
index,
);
AccountStorages::remove(address, index);
} else {
debug::debug!(
log::debug!(
target: "evm",
"Updating storage for {:?} [index: {:?}, value: {:?}]",
address,
Expand All @@ -476,7 +476,7 @@ impl<'vicinity, 'config, T: Config> StackStateT<'config> for SubstrateStackState
}

fn set_code(&mut self, address: H160, code: Vec<u8>) {
debug::debug!(
log::debug!(
target: "evm",
"Inserting code ({} bytes) at {:?}",
code.len(),
Expand Down
2 changes: 1 addition & 1 deletion primitives/evm/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ sp-core = { version = "3.0.0", git = "https://github.com/paritytech/substrate.gi
sp-std = { version = "3.0.0", git = "https://github.com/paritytech/substrate.git", branch = "frontier", default-features = false }
serde = { version = "1.0.101", optional = true, features = ["derive"] }
codec = { package = "parity-scale-codec", version = "2.0.0", default-features = false }
evm = { version = "0.24.0", default-features = false, features = ["with-codec"] }
evm = { version = "0.25.0", default-features = false, features = ["with-codec"] }
impl-trait-for-tuples = "0.1"

[features]
Expand Down
4 changes: 2 additions & 2 deletions primitives/storage/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ sp-core = { version = "3.0.0-dev", default-features = false, git = "https://gith
sp-api = { version = "3.0.0-dev", default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "frontier" }
fp-evm = { version = "0.8.0", default-features = false, path = "../../primitives/evm" }
ethereum = { version = "0.7.1", default-features = false, features = ["with-codec"] }
ethereum-types = { version = "0.9", default-features = false }
codec = { package = "parity-scale-codec", version = "1.0.0", default-features = false }
ethereum-types = { version = "0.11", default-features = false }
codec = { package = "parity-scale-codec", version = "2.0.0", default-features = false }
sp-runtime = { version = "3.0.0-dev", default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "frontier" }
sp-std = { version = "3.0.0-dev", default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "frontier" }

Expand Down
2 changes: 1 addition & 1 deletion template/node/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -64,4 +64,4 @@ substrate-build-script-utils = { git = "https://github.com/paritytech/substrate.
[features]
default = ["aura"]
aura = ["frontier-template-runtime/aura"]
manual-seal = ["frontier-template-runtime/manual-seal"]
manual-seal = ["frontier-template-runtime/manual-seal"]
26 changes: 13 additions & 13 deletions template/node/src/chain_spec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -135,28 +135,28 @@ fn testnet_genesis(
_enable_println: bool,
) -> GenesisConfig {
GenesisConfig {
frame_system: Some(SystemConfig {
frame_system: SystemConfig {
// Add Wasm runtime to storage.
code: wasm_binary.to_vec(),
changes_trie_config: Default::default(),
}),
pallet_balances: Some(BalancesConfig {
},
pallet_balances: BalancesConfig {
// Configure endowed accounts with initial balance of 1 << 60.
balances: endowed_accounts.iter().cloned().map(|k|(k, 1 << 60)).collect(),
}),
pallet_aura: Some(AuraConfig {
},
pallet_aura: AuraConfig {
authorities: initial_authorities.iter().map(|x| (x.0.clone())).collect(),
}),
pallet_grandpa: Some(GrandpaConfig {
},
pallet_grandpa: GrandpaConfig {
authorities: initial_authorities.iter().map(|x| (x.1.clone(), 1)).collect(),
}),
pallet_sudo: Some(SudoConfig {
},
pallet_sudo: SudoConfig {
// Assign network admin rights.
key: root_key,
}),
pallet_evm: Some(EVMConfig {
},
pallet_evm: EVMConfig {
accounts: BTreeMap::new(),
}),
pallet_ethereum: Some(EthereumConfig {}),
},
pallet_ethereum: EthereumConfig {},
}
}
1 change: 1 addition & 0 deletions template/node/src/rpc.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
//! A collection of node-specific RPC methods.
use std::sync::Arc;

use std::collections::BTreeMap;
use fc_rpc_core::types::{PendingTransactions, FilterPool};
use sc_consensus_manual_seal::rpc::{ManualSeal, ManualSealApi};
Expand Down
Loading

0 comments on commit da8f7ba

Please sign in to comment.