Skip to content

Commit

Permalink
Merge pull request #1102 from opentensor/devnet-ready
Browse files Browse the repository at this point in the history
devnet deploy 12-17-2024
  • Loading branch information
sam0x17 authored Dec 17, 2024
2 parents 142dd72 + 85fa7dd commit 16af5eb
Show file tree
Hide file tree
Showing 21 changed files with 427 additions and 302 deletions.
51 changes: 27 additions & 24 deletions Cargo.lock

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

46 changes: 23 additions & 23 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ sp-block-builder = { git = "https://github.com/paritytech/polkadot-sdk.git", tag
sp-blockchain = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2409", default-features = false }
sp-consensus = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2409" }
sp-consensus-aura = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2409", default-features = false }
sp-consensus-grandpa = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2409" }
sp-consensus-grandpa = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2409", default-features = false }
sp-genesis-builder = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2409", default-features = false }
sp-core = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2409", default-features = false }
sp-inherents = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2409", default-features = false }
Expand Down Expand Up @@ -166,32 +166,32 @@ sc-network-sync = { git = "https://github.com/paritytech/polkadot-sdk.git", tag
substrate-prometheus-endpoint = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2409", default-features = false }

# Frontier
fp-evm = { git = "https://github.com/gztensor/frontier", rev = "b8e3025", default-features = false }
fp-rpc = { git = "https://github.com/gztensor/frontier", rev = "b8e3025", default-features = false }
fp-self-contained = { git = "https://github.com/gztensor/frontier", rev = "b8e3025", default-features = false, features = [
fp-evm = { git = "https://github.com/gztensor/frontier", rev = "b9c606f9", default-features = false }
fp-rpc = { git = "https://github.com/gztensor/frontier", rev = "b9c606f9", default-features = false }
fp-self-contained = { git = "https://github.com/gztensor/frontier", rev = "b9c606f9", default-features = false, features = [
"serde",
] }
fp-account = { git = "https://github.com/gztensor/frontier", rev = "b8e3025", default-features = false }
fc-storage = { git = "https://github.com/gztensor/frontier", rev = "b8e3025", default-features = false }
fc-db = { git = "https://github.com/gztensor/frontier", rev = "b8e3025", default-features = false }
fc-consensus = { git = "https://github.com/gztensor/frontier", rev = "b8e3025", default-features = false }
fp-consensus = { git = "https://github.com/gztensor/frontier", rev = "b8e3025", default-features = false }
fp-dynamic-fee = { git = "https://github.com/gztensor/frontier", rev = "b8e3025", default-features = false }
fc-api = { git = "https://github.com/gztensor/frontier", rev = "b8e3025", default-features = false }
fc-rpc = { git = "https://github.com/gztensor/frontier", rev = "b8e3025", default-features = false }
fc-rpc-core = { git = "https://github.com/gztensor/frontier", rev = "b8e3025", default-features = false }
fc-mapping-sync = { git = "https://github.com/gztensor/frontier", rev = "b8e3025", default-features = false }
fp-account = { git = "https://github.com/gztensor/frontier", rev = "b9c606f9", default-features = false }
fc-storage = { git = "https://github.com/gztensor/frontier", rev = "b9c606f9", default-features = false }
fc-db = { git = "https://github.com/gztensor/frontier", rev = "b9c606f9", default-features = false }
fc-consensus = { git = "https://github.com/gztensor/frontier", rev = "b9c606f9", default-features = false }
fp-consensus = { git = "https://github.com/gztensor/frontier", rev = "b9c606f9", default-features = false }
fp-dynamic-fee = { git = "https://github.com/gztensor/frontier", rev = "b9c606f9", default-features = false }
fc-api = { git = "https://github.com/gztensor/frontier", rev = "b9c606f9", default-features = false }
fc-rpc = { git = "https://github.com/gztensor/frontier", rev = "b9c606f9", default-features = false }
fc-rpc-core = { git = "https://github.com/gztensor/frontier", rev = "b9c606f9", default-features = false }
fc-mapping-sync = { git = "https://github.com/gztensor/frontier", rev = "b9c606f9", default-features = false }

# Frontier FRAME
pallet-base-fee = { git = "https://github.com/gztensor/frontier", rev = "b8e3025", default-features = false }
pallet-dynamic-fee = { git = "https://github.com/gztensor/frontier", rev = "b8e3025", default-features = false }
pallet-ethereum = { git = "https://github.com/gztensor/frontier", rev = "b8e3025", default-features = false }
pallet-evm = { git = "https://github.com/gztensor/frontier", rev = "b8e3025", default-features = false }
pallet-evm-chain-id = { git = "https://github.com/gztensor/frontier", rev = "b8e3025", default-features = false }
pallet-evm-precompile-modexp = { git = "https://github.com/gztensor/frontier", rev = "b8e3025", default-features = false }
pallet-evm-precompile-sha3fips = { git = "https://github.com/gztensor/frontier", rev = "b8e3025", default-features = false }
pallet-evm-precompile-simple = { git = "https://github.com/gztensor/frontier", rev = "b8e3025", default-features = false }
pallet-hotfix-sufficients = { git = "https://github.com/gztensor/frontier", rev = "b8e3025", default-features = false }
pallet-base-fee = { git = "https://github.com/gztensor/frontier", rev = "b9c606f9", default-features = false }
pallet-dynamic-fee = { git = "https://github.com/gztensor/frontier", rev = "b9c606f9", default-features = false }
pallet-ethereum = { git = "https://github.com/gztensor/frontier", rev = "b9c606f9", default-features = false }
pallet-evm = { git = "https://github.com/gztensor/frontier", rev = "b9c606f9", default-features = false }
pallet-evm-chain-id = { git = "https://github.com/gztensor/frontier", rev = "b9c606f9", default-features = false }
pallet-evm-precompile-modexp = { git = "https://github.com/gztensor/frontier", rev = "b9c606f9", default-features = false }
pallet-evm-precompile-sha3fips = { git = "https://github.com/gztensor/frontier", rev = "b9c606f9", default-features = false }
pallet-evm-precompile-simple = { git = "https://github.com/gztensor/frontier", rev = "b9c606f9", default-features = false }
pallet-hotfix-sufficients = { git = "https://github.com/gztensor/frontier", rev = "b9c606f9", default-features = false }

#DRAND
pallet-drand = { path = "pallets/drand", default-features = false }
Expand Down
4 changes: 3 additions & 1 deletion chainspecs/plain_spec_finney.json

Large diffs are not rendered by default.

4 changes: 3 additions & 1 deletion chainspecs/raw_spec_finney.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions node/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ clap = { workspace = true, features = ["derive"] }
futures = { workspace = true, features = ["thread-pool"] }
scale-codec = { workspace = true }
serde = { workspace = true, features = ["derive"] }
hex = { workspace = true }

# Storage import
memmap2 = { workspace = true }
Expand Down
1 change: 1 addition & 0 deletions node/src/chain_spec/code_substitute_2585476.txt

Large diffs are not rendered by default.

23 changes: 21 additions & 2 deletions node/src/chain_spec/finney.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#![allow(clippy::unwrap_used)]

use super::*;
use hex::FromHex;

pub fn finney_mainnet_config() -> Result<ChainSpec, String> {
let path: PathBuf = std::path::PathBuf::from("./snapshot.json");
Expand Down Expand Up @@ -69,7 +70,7 @@ pub fn finney_mainnet_config() -> Result<ChainSpec, String> {
properties.insert("tokenDecimals".into(), 9.into());
properties.insert("ss58Format".into(), 42.into());

Ok(ChainSpec::builder(
let chain_spec = ChainSpec::builder(
wasm_binary,
Extensions {
bad_blocks: Some(HashSet::new()),
Expand Down Expand Up @@ -181,7 +182,25 @@ pub fn finney_mainnet_config() -> Result<ChainSpec, String> {
balances_issuance,
))
.with_properties(properties)
.build())
.build();

// Load and set the code substitute to avoid archive node sync panic
// See <https://github.com/opentensor/subtensor/pull/1051>
//
// Need to do it in this hacky way because the ChainSpec builder doesn't support setting it
let code_substitute_2585476_hex = include_bytes!("code_substitute_2585476.txt");
let chain_spec_json = chain_spec.as_json(false).unwrap();
let mut chain_spec_json = serde_json::from_str(&chain_spec_json).unwrap();
sc_chain_spec::set_code_substitute_in_json_chain_spec(
&mut chain_spec_json,
Vec::from_hex(code_substitute_2585476_hex)
.unwrap()
.as_slice(),
2585476,
);
let chain_spec_bytes = chain_spec_json.to_string().into_bytes();
let chain_spec = ChainSpec::from_json_bytes(chain_spec_bytes).unwrap();
Ok(chain_spec)
}

// Configure initial storage state for FRAME modules.
Expand Down
Loading

0 comments on commit 16af5eb

Please sign in to comment.