Skip to content

Commit c1c25e2

Browse files
authored
Merge pull request #1119 from opentensor/testnet
finney deploy 12-29-2024
2 parents 2050251 + 667029a commit c1c25e2

File tree

21 files changed

+427
-302
lines changed

21 files changed

+427
-302
lines changed

Cargo.lock

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

Cargo.toml

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ sp-block-builder = { git = "https://github.com/paritytech/polkadot-sdk.git", tag
138138
sp-blockchain = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2409", default-features = false }
139139
sp-consensus = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2409" }
140140
sp-consensus-aura = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2409", default-features = false }
141-
sp-consensus-grandpa = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2409" }
141+
sp-consensus-grandpa = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2409", default-features = false }
142142
sp-genesis-builder = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2409", default-features = false }
143143
sp-core = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2409", default-features = false }
144144
sp-inherents = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2409", default-features = false }
@@ -166,32 +166,32 @@ sc-network-sync = { git = "https://github.com/paritytech/polkadot-sdk.git", tag
166166
substrate-prometheus-endpoint = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2409", default-features = false }
167167

168168
# Frontier
169-
fp-evm = { git = "https://github.com/gztensor/frontier", rev = "b8e3025", default-features = false }
170-
fp-rpc = { git = "https://github.com/gztensor/frontier", rev = "b8e3025", default-features = false }
171-
fp-self-contained = { git = "https://github.com/gztensor/frontier", rev = "b8e3025", default-features = false, features = [
169+
fp-evm = { git = "https://github.com/gztensor/frontier", rev = "b9c606f9", default-features = false }
170+
fp-rpc = { git = "https://github.com/gztensor/frontier", rev = "b9c606f9", default-features = false }
171+
fp-self-contained = { git = "https://github.com/gztensor/frontier", rev = "b9c606f9", default-features = false, features = [
172172
"serde",
173173
] }
174-
fp-account = { git = "https://github.com/gztensor/frontier", rev = "b8e3025", default-features = false }
175-
fc-storage = { git = "https://github.com/gztensor/frontier", rev = "b8e3025", default-features = false }
176-
fc-db = { git = "https://github.com/gztensor/frontier", rev = "b8e3025", default-features = false }
177-
fc-consensus = { git = "https://github.com/gztensor/frontier", rev = "b8e3025", default-features = false }
178-
fp-consensus = { git = "https://github.com/gztensor/frontier", rev = "b8e3025", default-features = false }
179-
fp-dynamic-fee = { git = "https://github.com/gztensor/frontier", rev = "b8e3025", default-features = false }
180-
fc-api = { git = "https://github.com/gztensor/frontier", rev = "b8e3025", default-features = false }
181-
fc-rpc = { git = "https://github.com/gztensor/frontier", rev = "b8e3025", default-features = false }
182-
fc-rpc-core = { git = "https://github.com/gztensor/frontier", rev = "b8e3025", default-features = false }
183-
fc-mapping-sync = { git = "https://github.com/gztensor/frontier", rev = "b8e3025", default-features = false }
174+
fp-account = { git = "https://github.com/gztensor/frontier", rev = "b9c606f9", default-features = false }
175+
fc-storage = { git = "https://github.com/gztensor/frontier", rev = "b9c606f9", default-features = false }
176+
fc-db = { git = "https://github.com/gztensor/frontier", rev = "b9c606f9", default-features = false }
177+
fc-consensus = { git = "https://github.com/gztensor/frontier", rev = "b9c606f9", default-features = false }
178+
fp-consensus = { git = "https://github.com/gztensor/frontier", rev = "b9c606f9", default-features = false }
179+
fp-dynamic-fee = { git = "https://github.com/gztensor/frontier", rev = "b9c606f9", default-features = false }
180+
fc-api = { git = "https://github.com/gztensor/frontier", rev = "b9c606f9", default-features = false }
181+
fc-rpc = { git = "https://github.com/gztensor/frontier", rev = "b9c606f9", default-features = false }
182+
fc-rpc-core = { git = "https://github.com/gztensor/frontier", rev = "b9c606f9", default-features = false }
183+
fc-mapping-sync = { git = "https://github.com/gztensor/frontier", rev = "b9c606f9", default-features = false }
184184

185185
# Frontier FRAME
186-
pallet-base-fee = { git = "https://github.com/gztensor/frontier", rev = "b8e3025", default-features = false }
187-
pallet-dynamic-fee = { git = "https://github.com/gztensor/frontier", rev = "b8e3025", default-features = false }
188-
pallet-ethereum = { git = "https://github.com/gztensor/frontier", rev = "b8e3025", default-features = false }
189-
pallet-evm = { git = "https://github.com/gztensor/frontier", rev = "b8e3025", default-features = false }
190-
pallet-evm-chain-id = { git = "https://github.com/gztensor/frontier", rev = "b8e3025", default-features = false }
191-
pallet-evm-precompile-modexp = { git = "https://github.com/gztensor/frontier", rev = "b8e3025", default-features = false }
192-
pallet-evm-precompile-sha3fips = { git = "https://github.com/gztensor/frontier", rev = "b8e3025", default-features = false }
193-
pallet-evm-precompile-simple = { git = "https://github.com/gztensor/frontier", rev = "b8e3025", default-features = false }
194-
pallet-hotfix-sufficients = { git = "https://github.com/gztensor/frontier", rev = "b8e3025", default-features = false }
186+
pallet-base-fee = { git = "https://github.com/gztensor/frontier", rev = "b9c606f9", default-features = false }
187+
pallet-dynamic-fee = { git = "https://github.com/gztensor/frontier", rev = "b9c606f9", default-features = false }
188+
pallet-ethereum = { git = "https://github.com/gztensor/frontier", rev = "b9c606f9", default-features = false }
189+
pallet-evm = { git = "https://github.com/gztensor/frontier", rev = "b9c606f9", default-features = false }
190+
pallet-evm-chain-id = { git = "https://github.com/gztensor/frontier", rev = "b9c606f9", default-features = false }
191+
pallet-evm-precompile-modexp = { git = "https://github.com/gztensor/frontier", rev = "b9c606f9", default-features = false }
192+
pallet-evm-precompile-sha3fips = { git = "https://github.com/gztensor/frontier", rev = "b9c606f9", default-features = false }
193+
pallet-evm-precompile-simple = { git = "https://github.com/gztensor/frontier", rev = "b9c606f9", default-features = false }
194+
pallet-hotfix-sufficients = { git = "https://github.com/gztensor/frontier", rev = "b9c606f9", default-features = false }
195195

196196
#DRAND
197197
pallet-drand = { path = "pallets/drand", default-features = false }

chainspecs/plain_spec_finney.json

Lines changed: 3 additions & 1 deletion
Large diffs are not rendered by default.

chainspecs/raw_spec_finney.json

Lines changed: 3 additions & 1 deletion
Large diffs are not rendered by default.

node/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ clap = { workspace = true, features = ["derive"] }
2525
futures = { workspace = true, features = ["thread-pool"] }
2626
scale-codec = { workspace = true }
2727
serde = { workspace = true, features = ["derive"] }
28+
hex = { workspace = true }
2829

2930
# Storage import
3031
memmap2 = { workspace = true }

node/src/chain_spec/code_substitute_2585476.txt

Lines changed: 1 addition & 0 deletions
Large diffs are not rendered by default.

node/src/chain_spec/finney.rs

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
#![allow(clippy::unwrap_used)]
33

44
use super::*;
5+
use hex::FromHex;
56

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

72-
Ok(ChainSpec::builder(
73+
let chain_spec = ChainSpec::builder(
7374
wasm_binary,
7475
Extensions {
7576
bad_blocks: Some(HashSet::new()),
@@ -181,7 +182,25 @@ pub fn finney_mainnet_config() -> Result<ChainSpec, String> {
181182
balances_issuance,
182183
))
183184
.with_properties(properties)
184-
.build())
185+
.build();
186+
187+
// Load and set the code substitute to avoid archive node sync panic
188+
// See <https://github.com/opentensor/subtensor/pull/1051>
189+
//
190+
// Need to do it in this hacky way because the ChainSpec builder doesn't support setting it
191+
let code_substitute_2585476_hex = include_bytes!("code_substitute_2585476.txt");
192+
let chain_spec_json = chain_spec.as_json(false).unwrap();
193+
let mut chain_spec_json = serde_json::from_str(&chain_spec_json).unwrap();
194+
sc_chain_spec::set_code_substitute_in_json_chain_spec(
195+
&mut chain_spec_json,
196+
Vec::from_hex(code_substitute_2585476_hex)
197+
.unwrap()
198+
.as_slice(),
199+
2585476,
200+
);
201+
let chain_spec_bytes = chain_spec_json.to_string().into_bytes();
202+
let chain_spec = ChainSpec::from_json_bytes(chain_spec_bytes).unwrap();
203+
Ok(chain_spec)
185204
}
186205

187206
// Configure initial storage state for FRAME modules.

0 commit comments

Comments
 (0)