Skip to content

Commit 5e6b7f7

Browse files
Release v1.3.0 (#39)
* NODE-79, bifrost pallets improvements (#34) * NODE-79, feature: migrate to standard storage version for bfc-staking * NODE-79, feature: migrate to use new standard storage version for `bfc-offences`, `bfc-utility`, `relay-manager`. * NODE-79, refactor: replace `OrderedSet` with `BTreeMap` & `BTreeSet` * NODE-79, refactor: calculate translate weight info * NODE-79, refactor: Remove redundant code * NODE-79, refactor: Remove panic point in `bfc-staking` as much as possible * NODE-79, refactor: use btree set in `SelectedCandidates`, `SelectedFullCandidates`, `SelectedBasicCandidates`, `CachedSelectedCandidates` * NODE-79, refactor: remove unnecessary path prefix * NODE-79, refactor: remove unnecessary reverse * NODE-79, refactor: migrate `CandidatePool` to use BoundedBTreeMap * NODE-79, refactor: kill storage `MinTotalSelected` * NODE-79, refactor: remove unnecessary path prefix * NODE-79, fix: typo * NODE-79, refactor: use iter_mut * NODE-79, chore: remove deadcode * NODE-79, refactor: use mutate * NODE-79, refactor: clone in small range * NODE-79, refactor: no need to be complicate * NODE-79, refactor: use getter * NODE-79, fix: should use take instead get * NODE-79, refactor: remove dead code * NODE-79, refactor: no need to be complicated * NODE-79, refactor: use getter * NODE-79, refactor: `relay-manager` * NODE-79, refactor: . * NODE-79, refactor: remove redundant * NODE-79, fix: revert message * NODE-79, refactor: `bfc-staking` * NODE-79, refactor: `relay-manager` * NODE-79, refactor: move under util methods * NODE-79, refactor: impl From<Offence> for EvmOffence * NODE-79, refactor: reduce getter call * NODE-79, refactor: remove unnecessary clone * NODE-79, refactor: `Nominator.initial_nominations` type to BTreeMap * NODE-79, refactor: . * NODE-79, chore: remove dead code * NODE-79, fix: * NODE-79, fix: * NODE-79, test: fit into new storage format * NODE-79, fix: modify if exists else insert * NODE-79, refactor: remove dead code * NODE-79, fix: condition check on OnRuntimeUpgrade * NODE-79, chore: comment * NODE-79, fix: remove duplicate translate in migrations * NODE-65, deps: polkadot sdk migration (#36) * NODE-64, deps: upgrade to bifrost-polkadot-v1.3.0 * NODE-64, chore: use * NODE-64, chore: remove precompile utils * NODE-64, chore: replace to * NODE-64, chore: move to * NODE-65, chore: apply block number prelude to precompiles * NODE-65, chore: add hold/freeze reasons to * NODE-65, chore: remove hold identifier from * NODE-65, chore: add to * NODE-65, chore: add AllowMultipleBlocksPerSlot to pallet_aura * NODE-65, chore: add new types to pallet_treasury * NODE-65, chore: make pallet_preimage use Consideration * NODE-65, chore: add missing generic type to GenesisConfig * NODE-65, chore: update pallet_preimage * NODE-65, chore: add IdentityInformation to pallet_identity * NODE-65, chore: remove MaxPeerDataEncodingSize from pallet_im_online * NODE-65, chore: add SuicideQuickClearLimit to pallet_evm * NODE-65, feat: implement GenesisBuilder runtime api * NODE-65, chore: rename Index to Nonce * NODE-65, chore: specify txpool feature to fc_rpc * NODE-65, fix: pending runtime api for pending state * NODE-65, chore: Removal of execution strategies * NODE-65, chore: Set StateBackend::Transaction to PrefixedMemoryDB * NODE-65, chore: Modular block request handler * NODE-65, chore: implement eth_call state override * NODE-65, fix: resolve service.rs compile errors * NODE-65, fix: replace to RuntimeGenesisConfig in chain_spec * NODE-65, chore: add missing clone() * NODE-65, chore: remove native runtime version api * NODE-65, fix: replace to fp-account * NODE-65, fix: remove RuntimeFreezeReason and sort imports * NODE-65, chore: remove unneccessary self imports * NODE-65, fix: rollback cherry-picked EthereumRuntimeRPCApi changes * NODE-65, fix: add missing evm features * NODE-65, deps: release v1.3.0 * NODE-65, fix: remove unused params * NODE-65, fix: use correct crate features * NODE-65, fix: remove std feature on pallet GenesisConfig Default impl * NODE-65, test: replace deprecated storage * NODE-65, test: estimated gas should be correct * NODE-65, test: split runtime tests * NODE-65, test: check balance consistancy * NODE-65, test: check balance consistancy (2) * NODE-65, feat: Only use substrate-wasm-builder when std feature is enabled * NODE-65, deps: update Cargo.lock * NODE-65, fix: resolve imports * NODE-65, fix: update runtime tests * NODE-65, fix: handle runtime test failures * NODE-65, deps: update node packages * NODE-65, deps: update Cargo.lock * NODE-65, fix: remove test config * NODE-84, chore: bifrost-frontier/pull/12 (#37) * NODE-65, test: bifrost-frontier/pull/12 test code --------- Co-authored-by: Min-seong Kwon <kwonarseus@gmail.com> * NODE-78, fix: delayed relayer address update (#38) * NODE-64, deps: upgrade to bifrost-polkadot-v1.3.0 * NODE-65, fix: pending runtime api for pending state * NODE-65, chore: implement eth_call state override * NODE-65, test: split runtime tests * NODE-65, fix: update runtime tests * NODE-65, fix: handle runtime test failures * NODE-65, fix: remove test config * NODE-78, feat: use delayed relayer sets * NODE-78, feat: handle relayer sets on round update * NODE-78, fix: add verifications on scheduling leaves * NODE-78, test: add basic set relayer tests * NODE-78, test: add advanced tests * NODE-78, feat: add constraints to set_controller * NODE-78, feat: add constraints to set_validator_commission * NODE-78, chore: expect replacement will always succeed * NODE-78, chore: add missing string docs * NODE-78, fix: round update must be priorly set * NODE-78, chore: add missing string docs * NODE-78, fix: remove redundant state checks * deps: increase runtime version * test: update live runtime tests --------- Co-authored-by: Min-seong Kwon <kwonarseus@gmail.com>
1 parent c0e82fe commit 5e6b7f7

113 files changed

Lines changed: 7048 additions & 12042 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Cargo.lock

Lines changed: 1555 additions & 1037 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 140 additions & 137 deletions
Large diffs are not rendered by default.

node/common/Cargo.toml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "bifrost-common-node"
33
version = "1.0.0"
4-
description = "The common code shared between node specifications for Bifrost Node"
4+
description = "The common code shared between client implementations for Bifrost"
55
authors = { workspace = true }
66
homepage = { workspace = true }
77
edition = { workspace = true }
@@ -27,6 +27,9 @@ sc-network-sync = { workspace = true }
2727
sc-service = { workspace = true }
2828
substrate-prometheus-endpoint = { workspace = true }
2929

30+
# benchmarking dependencies
31+
frame-benchmarking = { workspace = true, features = ["std"] }
32+
3033
# substrate primitives dependencies
3134
sp-core = { workspace = true, features = ["std"] }
3235
sp-runtime = { workspace = true, features = ["std"] }
@@ -36,13 +39,15 @@ sp-block-builder = { workspace = true, features = ["std"] }
3639

3740
# Frontier dependencies
3841
fc-db = { workspace = true }
42+
fc-api = { workspace = true }
3943
fc-rpc = { workspace = true, features = ["rpc-binary-search-estimate"] }
4044
fc-rpc-core = { workspace = true }
4145
fp-rpc-debug = { workspace = true }
4246
fp-storage = { workspace = true }
4347
fp-rpc = { workspace = true }
4448
fc-rpc-debug = { workspace = true }
4549
fc-rpc-trace = { workspace = true }
50+
fp-ext = { workspace = true, features = ["std"] }
4651

4752
# Local Dependencies
4853
bp-core = { workspace = true }

node/common/src/rpc.rs

Lines changed: 31 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
use crate::cli_opt::EthApi as EthApiCmd;
2-
use bp_core::{BlockNumber, Hash, Header};
2+
3+
use std::{collections::BTreeMap, sync::Arc};
4+
35
use fc_rpc::{
46
EthBlockDataCacheTask, OverrideHandle, RuntimeApiStorageOverride, SchemaV1Override,
57
SchemaV2Override, SchemaV3Override, StorageOverride,
68
};
79
use fc_rpc_core::types::{FeeHistoryCache, FilterPool};
8-
use fp_rpc::{self, EthereumRuntimeRPCApi};
9-
use fp_storage::EthereumStorageSchema;
1010
use sc_client_api::{backend::Backend, StorageProvider};
1111
use sc_consensus_grandpa::{
1212
FinalityProofProvider, GrandpaJustificationStream, SharedAuthoritySet, SharedVoterState,
@@ -18,14 +18,29 @@ use sc_rpc::SubscriptionTaskExecutor;
1818
use sc_rpc_api::DenyUnsafe;
1919
use sc_service::TaskManager;
2020
use sc_transaction_pool::{ChainApi, Pool};
21+
22+
use bp_core::{BlockNumber, Hash, Header};
23+
use fp_rpc::{self, EthereumRuntimeRPCApi};
24+
use fp_storage::EthereumStorageSchema;
2125
use sp_api::ProvideRuntimeApi;
2226
use sp_blockchain::HeaderBackend;
2327
use sp_core::H256;
2428
use sp_runtime::{generic, traits::Block as BlockT, OpaqueExtrinsic as UncheckedExtrinsic};
25-
use std::{collections::BTreeMap, sync::Arc};
2629

2730
pub type Block = generic::Block<Header, UncheckedExtrinsic>;
2831

32+
pub struct DefaultEthConfig<C, BE>(std::marker::PhantomData<(C, BE)>);
33+
34+
impl<C, BE> fc_rpc::EthConfig<Block, C> for DefaultEthConfig<C, BE>
35+
where
36+
C: StorageProvider<Block, BE> + Sync + Send + 'static,
37+
BE: Backend<Block> + 'static,
38+
{
39+
type EstimateGasAdapter = ();
40+
type RuntimeStorageOverride =
41+
fc_rpc::frontier_backend_client::SystemAccountId20StorageOverride<Block, C, BE>;
42+
}
43+
2944
/// Override storage
3045
pub fn overrides_handle<B, C, BE>(client: Arc<C>) -> Arc<OverrideHandle<B>>
3146
where
@@ -70,7 +85,9 @@ pub struct GrandpaDeps<B> {
7085
}
7186

7287
/// Full client dependencies.
73-
pub struct FullDevDeps<C, P, BE, SC, A: ChainApi> {
88+
pub struct FullDevDeps<C, P, BE, SC, A: ChainApi, CIDP> {
89+
/// Client version.
90+
pub client_version: String,
7491
/// The client instance to use.
7592
pub client: Arc<C>,
7693
/// Transaction pool instance.
@@ -94,7 +111,7 @@ pub struct FullDevDeps<C, P, BE, SC, A: ChainApi> {
94111
/// List of optional RPC extensions.
95112
pub ethapi_cmd: Vec<EthApiCmd>,
96113
/// Frontier backend.
97-
pub frontier_backend: Arc<dyn fc_db::BackendReader<Block> + Send + Sync>,
114+
pub frontier_backend: Arc<dyn fc_api::Backend<Block> + Send + Sync>,
98115
/// Backend.
99116
pub backend: Arc<BE>,
100117
/// Maximum fee history cache size.
@@ -115,10 +132,14 @@ pub struct FullDevDeps<C, P, BE, SC, A: ChainApi> {
115132
pub forced_parent_hashes: Option<BTreeMap<H256, H256>>,
116133
/// Chain syncing service
117134
pub sync_service: Arc<SyncingService<Block>>,
135+
/// Something that can create the inherent data providers for pending state
136+
pub pending_create_inherent_data_providers: CIDP,
118137
}
119138

120139
/// Mainnet/Testnet client dependencies.
121-
pub struct FullDeps<C, P, BE, SC, A: ChainApi> {
140+
pub struct FullDeps<C, P, BE, SC, A: ChainApi, CIDP> {
141+
/// Client version.
142+
pub client_version: String,
122143
/// The client instance to use.
123144
pub client: Arc<C>,
124145
/// Transaction pool instance.
@@ -142,7 +163,7 @@ pub struct FullDeps<C, P, BE, SC, A: ChainApi> {
142163
/// List of optional RPC extensions.
143164
pub ethapi_cmd: Vec<EthApiCmd>,
144165
/// Frontier backend.
145-
pub frontier_backend: Arc<dyn fc_db::BackendReader<Block> + Send + Sync>,
166+
pub frontier_backend: Arc<dyn fc_api::Backend<Block> + Send + Sync>,
146167
/// Backend.
147168
pub backend: Arc<BE>,
148169
/// Maximum fee history cache size.
@@ -161,6 +182,8 @@ pub struct FullDeps<C, P, BE, SC, A: ChainApi> {
161182
pub forced_parent_hashes: Option<BTreeMap<H256, H256>>,
162183
/// Chain syncing service
163184
pub sync_service: Arc<SyncingService<Block>>,
185+
/// Something that can create the inherent data providers for pending state
186+
pub pending_create_inherent_data_providers: CIDP,
164187
}
165188

166189
pub struct SpawnTasksParams<'a, B: BlockT, C, BE> {

node/common/src/service.rs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,21 @@
1-
use bp_core::Block;
1+
use crate::cli_opt::{BackendTypeConfig, RpcConfig};
2+
3+
use std::{path::Path, sync::Arc};
4+
25
use fc_db::DatabaseSource;
36
use sc_client_api::{
47
backend::{Backend, StateBackend},
58
AuxStore, StorageProvider,
69
};
710
use sc_service::Configuration;
11+
12+
use bp_core::Block;
813
use sp_api::ProvideRuntimeApi;
914
use sp_blockchain::{Error as BlockChainError, HeaderBackend, HeaderMetadata};
1015
use sp_runtime::traits::BlakeTwo256;
11-
use std::{path::Path, sync::Arc};
1216

13-
use crate::cli_opt::{BackendTypeConfig, RpcConfig};
17+
pub type HostFunctions =
18+
(frame_benchmarking::benchmarking::HostFunctions, fp_ext::bifrost_ext::HostFunctions);
1419

1520
/// Configure frontier database.
1621
pub fn frontier_database_dir(config: &Configuration, path: &str) -> std::path::PathBuf {

node/core/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "bifrost-node"
3-
version = "1.2.5"
4-
description = "The node specification for Bifrost Node"
3+
version = "1.3.0"
4+
description = "The node client implementation for Bifrost"
55
authors = { workspace = true }
66
homepage = { workspace = true }
77
edition = { workspace = true }

node/core/src/command.rs

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ use crate::cli::{Cli, Subcommand};
33
use bifrost_common_node::cli_opt::{BackendType, BackendTypeConfig, RpcConfig};
44

55
use frame_benchmarking_cli::{BenchmarkCmd, SUBSTRATE_REFERENCE_HARDWARE};
6-
use sc_cli::{ChainSpec, RuntimeVersion, SubstrateCli};
6+
7+
use sc_cli::SubstrateCli;
78
use sc_service::PartialComponents;
89

910
trait IdentifyChain {
@@ -54,7 +55,7 @@ impl SubstrateCli for Cli {
5455
}
5556

5657
fn support_url() -> String {
57-
"support.anonymous.an".into()
58+
env!("CARGO_PKG_HOMEPAGE").into()
5859
}
5960

6061
fn copyright_start_year() -> i32 {
@@ -77,18 +78,6 @@ impl SubstrateCli for Cli {
7778
)?),
7879
})
7980
}
80-
81-
fn native_runtime_version(chain_spec: &Box<dyn ChainSpec>) -> &'static RuntimeVersion {
82-
if chain_spec.is_dev() {
83-
&bifrost_dev_runtime::VERSION
84-
} else if chain_spec.is_testnet() {
85-
&bifrost_testnet_runtime::VERSION
86-
} else if chain_spec.is_mainnet() {
87-
&bifrost_mainnet_runtime::VERSION
88-
} else {
89-
&bifrost_dev_runtime::VERSION
90-
}
91-
}
9281
}
9382

9483
/// Parse and run command line arguments
@@ -288,6 +277,8 @@ pub fn run() -> sc_cli::Result<()> {
288277
}
289278
},
290279
Some(Subcommand::Benchmark(cmd)) => {
280+
use bifrost_common_node::rpc::Block;
281+
291282
let runner = cli.create_runner(cmd)?;
292283

293284
runner.sync_run(|config| {
@@ -303,7 +294,7 @@ pub fn run() -> sc_cli::Result<()> {
303294
);
304295
}
305296

306-
cmd.run::<bifrost_dev_runtime::Block, bifrost_dev_node::service::dev::ExecutorDispatch>(config)
297+
cmd.run::<Block, bifrost_common_node::service::HostFunctions>(config)
307298
},
308299
BenchmarkCmd::Block(cmd) => {
309300
let PartialComponents { client, .. } =

node/dev/Cargo.toml

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
[package]
22
name = "bifrost-dev-node"
33
version = "1.0.0"
4-
description = "The node specification for Bifrost Node development"
4+
description = "The node client implementation for Bifrost dev chain"
55
authors = { workspace = true }
6-
homepage = { workspace = true}
6+
homepage = { workspace = true }
77
edition = { workspace = true }
88
license = { workspace = true }
99
repository = { workspace = true }
@@ -34,6 +34,7 @@ sc-rpc = { workspace = true }
3434
sc-rpc-api = { workspace = true }
3535
sc-chain-spec = { workspace = true }
3636
sc-basic-authorship = { workspace = true }
37+
sc-offchain = { workspace = true }
3738

3839
# substrate primitives dependencies
3940
sp-core = { workspace = true, features = ["std"] }
@@ -46,6 +47,7 @@ sp-block-builder = { workspace = true, features = ["std"] }
4647
sp-timestamp = { workspace = true, features = ["std"] }
4748
sp-blockchain = { workspace = true }
4849
sp-consensus = { workspace = true }
50+
sp-inherents = { workspace = true }
4951

5052
# FRAME dependencies
5153
pallet-bfc-staking = { workspace = true }
@@ -66,9 +68,10 @@ fp-storage = { workspace = true }
6668
fp-ext = { workspace = true, features = ["std"] }
6769
fp-rpc = { workspace = true, features = ["std"] }
6870
fp-rpc-txpool = { workspace = true, features = ["std"] }
69-
pallet-evm = { workspace = true, features = ["std"] }
70-
71-
pallet-ethereum = { workspace = true, features = ["forbid-evm-reentrancy"] }
71+
pallet-ethereum = { workspace = true, features = [
72+
"std",
73+
"forbid-evm-reentrancy",
74+
] }
7275

7376
# benchmarking dependencies
7477
frame-benchmarking-cli = { workspace = true }
@@ -82,6 +85,4 @@ bifrost-common-node = { workspace = true }
8285

8386
[features]
8487
default = []
85-
runtime-benchmarks = [
86-
"bifrost-dev-runtime/runtime-benchmarks",
87-
]
88+
runtime-benchmarks = ["bifrost-dev-runtime/runtime-benchmarks"]

node/dev/src/chain_spec.rs

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ use sp_runtime::{BoundedVec, Perbill};
1616
use hex_literal::hex;
1717

1818
/// Specialized `ChainSpec`. This is a specialization of the general Substrate ChainSpec type.
19-
pub type ChainSpec = sc_service::GenericChainSpec<devnet::GenesisConfig>;
19+
pub type ChainSpec = sc_service::GenericChainSpec<devnet::RuntimeGenesisConfig>;
2020

2121
/// Generate a crypto pair from seed.
2222
pub fn get_from_seed<TPublic: Public>(seed: &str) -> <TPublic::Pair as Pair>::Public {
@@ -132,7 +132,6 @@ pub fn development_config() -> Result<ChainSpec, String> {
132132
AccountId::from(hex!("f4fc2d9Be3D6e19cCAfd575dE7CB290A585A1a22")),
133133
AccountId::from(hex!("962dBf2aecF6545f552373487127976fD5B55105")),
134134
],
135-
true,
136135
)
137136
},
138137
// Bootnodes
@@ -170,17 +169,12 @@ fn development_genesis(
170169
initial_tech_committee_members: Vec<AccountId>,
171170
root_key: AccountId,
172171
endowed_accounts: Vec<AccountId>,
173-
_enable_println: bool,
174-
) -> devnet::GenesisConfig {
175-
// This is the simplest bytecode to revert without returning any data.
176-
// We will pre-deploy it under all of our precompiles to ensure they can be called from
177-
// within contracts.
178-
// (PUSH1 0x00 PUSH1 0x00 REVERT)
179-
let _revert_bytecode = vec![0x60, 0x00, 0x60, 0x00, 0xFD];
180-
devnet::GenesisConfig {
172+
) -> devnet::RuntimeGenesisConfig {
173+
devnet::RuntimeGenesisConfig {
181174
system: devnet::SystemConfig {
182175
// Add Wasm runtime to storage.
183176
code: wasm_binary.to_vec(),
177+
..Default::default()
184178
},
185179
balances: devnet::BalancesConfig {
186180
balances: endowed_accounts

0 commit comments

Comments
 (0)