diff --git a/parachain/Cargo.lock b/parachain/Cargo.lock index e63080141177f..71c3a92562b2f 100644 --- a/parachain/Cargo.lock +++ b/parachain/Cargo.lock @@ -10089,7 +10089,6 @@ dependencies = [ "snowbridge-erc20-app", "snowbridge-eth-app", "snowbridge-ethereum-beacon-client", - "snowbridge-ethereum-light-client", "snowbridge-incentivized-channel", "snowbridge-runtime-common", "snowbridge-runtime-primitives", @@ -10161,7 +10160,6 @@ dependencies = [ "snowbridge-erc20-app", "snowbridge-eth-app", "snowbridge-ethereum-beacon-client", - "snowbridge-ethereum-light-client", "snowbridge-incentivized-channel", "snowbridge-runtime-common", "snowbridge-runtime-primitives", @@ -10642,7 +10640,6 @@ dependencies = [ "snowbridge-erc20-app", "snowbridge-eth-app", "snowbridge-ethereum-beacon-client", - "snowbridge-ethereum-light-client", "snowbridge-incentivized-channel", "snowbridge-runtime-common", "snowbridge-runtime-primitives", diff --git a/parachain/runtime/snowbase/Cargo.toml b/parachain/runtime/snowbase/Cargo.toml index e670827a66a66..35905da0e0e52 100644 --- a/parachain/runtime/snowbase/Cargo.toml +++ b/parachain/runtime/snowbase/Cargo.toml @@ -75,7 +75,6 @@ snowbridge-asset-registry = { path = "../../pallets/asset-registry", default-fea snowbridge-basic-channel = { path = "../../pallets/basic-channel", default-features = false } snowbridge-incentivized-channel = { path = "../../pallets/incentivized-channel", default-features = false } dispatch = { path = "../../pallets/dispatch", package = "snowbridge-dispatch", default-features = false } -ethereum-light-client = { path = "../../pallets/ethereum-light-client", package = "snowbridge-ethereum-light-client", default-features = false } ethereum-beacon-client = { path = "../../pallets/ethereum-beacon-client", package = "snowbridge-ethereum-beacon-client", default-features = false, features=["minimal"]} dot-app = { path = "../../pallets/dot-app", package = "snowbridge-dot-app", default-features = false } eth-app = { path = "../../pallets/eth-app", package = "snowbridge-eth-app", default-features = false } @@ -140,7 +139,6 @@ std = [ "polkadot-parachain/std", "snowbridge-basic-channel/std", "snowbridge-incentivized-channel/std", - "ethereum-light-client/std", "ethereum-beacon-client/std", "dispatch/std", "dot-app/std", @@ -175,5 +173,4 @@ runtime-benchmarks = [ "dispatch/runtime-benchmarks", "erc20-app/runtime-benchmarks", "eth-app/runtime-benchmarks", - "ethereum-light-client/runtime-benchmarks" ] diff --git a/parachain/runtime/snowbase/src/lib.rs b/parachain/runtime/snowbase/src/lib.rs index de1d754c125a3..e17ea2b1742f1 100644 --- a/parachain/runtime/snowbase/src/lib.rs +++ b/parachain/runtime/snowbase/src/lib.rs @@ -49,8 +49,6 @@ pub use sp_runtime::{traits::AccountIdConversion, Perbill, Permill}; use dispatch::EnsureEthereumAccount; pub use snowbridge_core::{ChannelId, MessageId}; -pub use ethereum_light_client::{EthereumDifficultyConfig, EthereumHeader}; - use polkadot_parachain::primitives::Sibling; use pallet_xcm::XcmPassthrough; @@ -612,22 +610,6 @@ impl incentivized_channel_outbound::Config for Runtime { type WeightInfo = incentivized_channel_outbound::weights::SnowbridgeWeight; } -parameter_types! { - pub const DescendantsUntilFinalized: u8 = 1; - pub const DifficultyConfig: EthereumDifficultyConfig = EthereumDifficultyConfig::ropsten(); - pub const VerifyPoW: bool = false; - pub const MaxHeadersForNumber: u32 = 100; -} - -impl ethereum_light_client::Config for Runtime { - type Event = Event; - type DescendantsUntilFinalized = DescendantsUntilFinalized; - type DifficultyConfig = DifficultyConfig; - type VerifyPoW = VerifyPoW; - type MaxHeadersForNumber = MaxHeadersForNumber; - type WeightInfo = ethereum_light_client::weights::SnowbridgeWeight; -} - impl ethereum_beacon_client::Config for Runtime { type Event = Event; } @@ -760,7 +742,6 @@ construct_runtime!( IncentivizedInboundChannel: incentivized_channel_inbound::{Pallet, Call, Config, Storage, Event} = 14, IncentivizedOutboundChannel: incentivized_channel_outbound::{Pallet, Call, Config, Storage, Event} = 15, Dispatch: dispatch::{Pallet, Call, Storage, Event, Origin} = 16, - EthereumLightClient: ethereum_light_client::{Pallet, Call, Config, Storage, Event} = 17, EthereumBeaconClient: ethereum_beacon_client::{Pallet, Call, Config, Storage, Event} = 18, Assets: pallet_assets::{Pallet, Call, Config, Storage, Event} = 19, AssetRegistry: snowbridge_asset_registry::{Pallet, Storage, Config} = 20, @@ -945,7 +926,6 @@ impl_runtime_apis! { list_benchmark!(list, extra, pallet_timestamp, Timestamp); list_benchmark!(list, extra, pallet_utility, Utility); list_benchmark!(list, extra, pallet_scheduler, Scheduler); - list_benchmark!(list, extra, ethereum_light_client, EthereumLightClient); list_benchmark!(list, extra, assets, Assets); list_benchmark!(list, extra, basic_channel_outbound, BasicOutboundChannel); list_benchmark!(list, extra, incentivized_channel_inbound, IncentivizedInboundChannel); @@ -998,7 +978,6 @@ impl_runtime_apis! { add_benchmark!(params, batches, pallet_timestamp, Timestamp); add_benchmark!(params, batches, pallet_utility, Utility); add_benchmark!(params, batches, pallet_scheduler, Scheduler); - add_benchmark!(params, batches, ethereum_light_client, EthereumLightClient); add_benchmark!(params, batches, assets, Assets); add_benchmark!(params, batches, basic_channel_outbound, BasicOutboundChannel); add_benchmark!(params, batches, incentivized_channel_inbound, IncentivizedInboundChannel); diff --git a/parachain/runtime/snowblink/Cargo.toml b/parachain/runtime/snowblink/Cargo.toml index 7e7d717aedbf4..1795de5d1c93b 100644 --- a/parachain/runtime/snowblink/Cargo.toml +++ b/parachain/runtime/snowblink/Cargo.toml @@ -74,7 +74,6 @@ snowbridge-asset-registry = { path = "../../pallets/asset-registry", default-fea snowbridge-basic-channel = { path = "../../pallets/basic-channel", default-features = false } snowbridge-incentivized-channel = { path = "../../pallets/incentivized-channel", default-features = false } dispatch = { path = "../../pallets/dispatch", package = "snowbridge-dispatch", default-features = false } -ethereum-light-client = { path = "../../pallets/ethereum-light-client", package = "snowbridge-ethereum-light-client", default-features = false } ethereum-beacon-client = { path = "../../pallets/ethereum-beacon-client", package = "snowbridge-ethereum-beacon-client", default-features = false} dot-app = { path = "../../pallets/dot-app", package = "snowbridge-dot-app", default-features = false } eth-app = { path = "../../pallets/eth-app", package = "snowbridge-eth-app", default-features = false } @@ -139,7 +138,6 @@ std = [ "polkadot-parachain/std", "snowbridge-basic-channel/std", "snowbridge-incentivized-channel/std", - "ethereum-light-client/std", "ethereum-beacon-client/std", "dispatch/std", "dot-app/std", @@ -174,5 +172,4 @@ runtime-benchmarks = [ "dispatch/runtime-benchmarks", "erc20-app/runtime-benchmarks", "eth-app/runtime-benchmarks", - "ethereum-light-client/runtime-benchmarks" ] diff --git a/parachain/runtime/snowblink/src/lib.rs b/parachain/runtime/snowblink/src/lib.rs index b5e585ebb341f..7cdc6f85898f0 100644 --- a/parachain/runtime/snowblink/src/lib.rs +++ b/parachain/runtime/snowblink/src/lib.rs @@ -49,8 +49,6 @@ pub use sp_runtime::{traits::AccountIdConversion, Perbill, Permill}; use dispatch::EnsureEthereumAccount; pub use snowbridge_core::{ChannelId, MessageId}; -pub use ethereum_light_client::{EthereumDifficultyConfig, EthereumHeader}; - use polkadot_parachain::primitives::Sibling; use pallet_xcm::XcmPassthrough; @@ -612,22 +610,6 @@ impl incentivized_channel_outbound::Config for Runtime { type WeightInfo = incentivized_channel_outbound::weights::SnowbridgeWeight; } -parameter_types! { - pub const DescendantsUntilFinalized: u8 = 16; - pub const DifficultyConfig: EthereumDifficultyConfig = EthereumDifficultyConfig::ropsten(); - pub const VerifyPoW: bool = false; - pub const MaxHeadersForNumber: u32 = 100; -} - -impl ethereum_light_client::Config for Runtime { - type Event = Event; - type DescendantsUntilFinalized = DescendantsUntilFinalized; - type DifficultyConfig = DifficultyConfig; - type VerifyPoW = VerifyPoW; - type MaxHeadersForNumber = MaxHeadersForNumber; - type WeightInfo = ethereum_light_client::weights::SnowbridgeWeight; -} - impl ethereum_beacon_client::Config for Runtime { type Event = Event; } @@ -760,7 +742,6 @@ construct_runtime!( IncentivizedInboundChannel: incentivized_channel_inbound::{Pallet, Call, Config, Storage, Event} = 14, IncentivizedOutboundChannel: incentivized_channel_outbound::{Pallet, Call, Config, Storage, Event} = 15, Dispatch: dispatch::{Pallet, Call, Storage, Event, Origin} = 16, - EthereumLightClient: ethereum_light_client::{Pallet, Call, Config, Storage, Event} = 17, EthereumBeaconClient: ethereum_beacon_client::{Pallet, Call, Config, Storage, Event} = 18, Assets: pallet_assets::{Pallet, Call, Config, Storage, Event} = 19, AssetRegistry: snowbridge_asset_registry::{Pallet, Storage, Config} = 20, @@ -945,7 +926,6 @@ impl_runtime_apis! { list_benchmark!(list, extra, pallet_timestamp, Timestamp); list_benchmark!(list, extra, pallet_utility, Utility); list_benchmark!(list, extra, pallet_scheduler, Scheduler); - list_benchmark!(list, extra, ethereum_light_client, EthereumLightClient); list_benchmark!(list, extra, assets, Assets); list_benchmark!(list, extra, basic_channel_outbound, BasicOutboundChannel); list_benchmark!(list, extra, incentivized_channel_inbound, IncentivizedInboundChannel); @@ -998,7 +978,6 @@ impl_runtime_apis! { add_benchmark!(params, batches, pallet_timestamp, Timestamp); add_benchmark!(params, batches, pallet_utility, Utility); add_benchmark!(params, batches, pallet_scheduler, Scheduler); - add_benchmark!(params, batches, ethereum_light_client, EthereumLightClient); add_benchmark!(params, batches, assets, Assets); add_benchmark!(params, batches, basic_channel_outbound, BasicOutboundChannel); add_benchmark!(params, batches, incentivized_channel_inbound, IncentivizedInboundChannel); diff --git a/parachain/runtime/snowbridge/Cargo.toml b/parachain/runtime/snowbridge/Cargo.toml index 8595dd980ccd3..adfa9d768f9cd 100644 --- a/parachain/runtime/snowbridge/Cargo.toml +++ b/parachain/runtime/snowbridge/Cargo.toml @@ -74,7 +74,6 @@ snowbridge-asset-registry = { path = "../../pallets/asset-registry", default-fea snowbridge-basic-channel = { path = "../../pallets/basic-channel", default-features = false } snowbridge-incentivized-channel = { path = "../../pallets/incentivized-channel", default-features = false } dispatch = { path = "../../pallets/dispatch", package = "snowbridge-dispatch", default-features = false } -ethereum-light-client = { path = "../../pallets/ethereum-light-client", package = "snowbridge-ethereum-light-client", default-features = false } ethereum-beacon-client = { path = "../../pallets/ethereum-beacon-client", package = "snowbridge-ethereum-beacon-client", default-features = false} dot-app = { path = "../../pallets/dot-app", package = "snowbridge-dot-app", default-features = false } eth-app = { path = "../../pallets/eth-app", package = "snowbridge-eth-app", default-features = false } @@ -139,7 +138,6 @@ std = [ "polkadot-parachain/std", "snowbridge-basic-channel/std", "snowbridge-incentivized-channel/std", - "ethereum-light-client/std", "ethereum-beacon-client/std", "dispatch/std", "dot-app/std", @@ -174,5 +172,4 @@ runtime-benchmarks = [ "dispatch/runtime-benchmarks", "erc20-app/runtime-benchmarks", "eth-app/runtime-benchmarks", - "ethereum-light-client/runtime-benchmarks" ] diff --git a/parachain/runtime/snowbridge/src/lib.rs b/parachain/runtime/snowbridge/src/lib.rs index d89093e30e6e8..5248bc672766e 100644 --- a/parachain/runtime/snowbridge/src/lib.rs +++ b/parachain/runtime/snowbridge/src/lib.rs @@ -49,8 +49,6 @@ pub use sp_runtime::{traits::AccountIdConversion, Perbill, Permill}; use dispatch::EnsureEthereumAccount; pub use snowbridge_core::{ChannelId, MessageId}; -pub use ethereum_light_client::{EthereumDifficultyConfig, EthereumHeader}; - use polkadot_parachain::primitives::Sibling; use pallet_xcm::XcmPassthrough; @@ -612,22 +610,6 @@ impl incentivized_channel_outbound::Config for Runtime { type WeightInfo = incentivized_channel_outbound::weights::SnowbridgeWeight; } -parameter_types! { - pub const DescendantsUntilFinalized: u8 = 3; - pub const DifficultyConfig: EthereumDifficultyConfig = EthereumDifficultyConfig::mainnet(); - pub const VerifyPoW: bool = true; - pub const MaxHeadersForNumber: u32 = 100; -} - -impl ethereum_light_client::Config for Runtime { - type Event = Event; - type DescendantsUntilFinalized = DescendantsUntilFinalized; - type DifficultyConfig = DifficultyConfig; - type VerifyPoW = VerifyPoW; - type MaxHeadersForNumber = MaxHeadersForNumber; - type WeightInfo = ethereum_light_client::weights::SnowbridgeWeight; -} - impl ethereum_beacon_client::Config for Runtime { type Event = Event; } @@ -760,7 +742,6 @@ construct_runtime!( IncentivizedInboundChannel: incentivized_channel_inbound::{Pallet, Call, Config, Storage, Event} = 14, IncentivizedOutboundChannel: incentivized_channel_outbound::{Pallet, Call, Config, Storage, Event} = 15, Dispatch: dispatch::{Pallet, Call, Storage, Event, Origin} = 16, - EthereumLightClient: ethereum_light_client::{Pallet, Call, Config, Storage, Event} = 17, EthereumBeaconClient: ethereum_beacon_client::{Pallet, Call, Config, Storage, Event} = 18, Assets: pallet_assets::{Pallet, Call, Config, Storage, Event} = 19, AssetRegistry: snowbridge_asset_registry::{Pallet, Storage, Config} = 20, @@ -945,7 +926,6 @@ impl_runtime_apis! { list_benchmark!(list, extra, pallet_timestamp, Timestamp); list_benchmark!(list, extra, pallet_utility, Utility); list_benchmark!(list, extra, pallet_scheduler, Scheduler); - list_benchmark!(list, extra, ethereum_light_client, EthereumLightClient); list_benchmark!(list, extra, assets, Assets); list_benchmark!(list, extra, basic_channel_outbound, BasicOutboundChannel); list_benchmark!(list, extra, incentivized_channel_inbound, IncentivizedInboundChannel); @@ -998,7 +978,6 @@ impl_runtime_apis! { add_benchmark!(params, batches, pallet_timestamp, Timestamp); add_benchmark!(params, batches, pallet_utility, Utility); add_benchmark!(params, batches, pallet_scheduler, Scheduler); - add_benchmark!(params, batches, ethereum_light_client, EthereumLightClient); add_benchmark!(params, batches, assets, Assets); add_benchmark!(params, batches, basic_channel_outbound, BasicOutboundChannel); add_benchmark!(params, batches, incentivized_channel_inbound, IncentivizedInboundChannel); diff --git a/parachain/src/chain_spec/snowbase.rs b/parachain/src/chain_spec/snowbase.rs index 225c8ba0ff0b2..f5288a1c81a53 100644 --- a/parachain/src/chain_spec/snowbase.rs +++ b/parachain/src/chain_spec/snowbase.rs @@ -119,10 +119,6 @@ fn testnet_genesis( }, asset_registry: snowbase_runtime::AssetRegistryConfig { next_asset_id: 1 }, xcm_support: snowbase_runtime::XcmSupportConfig {}, - ethereum_light_client: snowbase_runtime::EthereumLightClientConfig { - initial_header: Default::default(), - initial_difficulty: Default::default(), - }, ethereum_beacon_client: snowbase_runtime::EthereumBeaconClientConfig { initial_sync: Default::default(), }, diff --git a/parachain/src/chain_spec/snowblink.rs b/parachain/src/chain_spec/snowblink.rs index 8207d89ec3770..4179d8b6ee73c 100644 --- a/parachain/src/chain_spec/snowblink.rs +++ b/parachain/src/chain_spec/snowblink.rs @@ -119,10 +119,6 @@ fn testnet_genesis( }, asset_registry: snowblink_runtime::AssetRegistryConfig { next_asset_id: 1 }, xcm_support: snowblink_runtime::XcmSupportConfig {}, - ethereum_light_client: snowblink_runtime::EthereumLightClientConfig { - initial_header: Default::default(), - initial_difficulty: Default::default(), - }, ethereum_beacon_client: snowblink_runtime::EthereumBeaconClientConfig { initial_sync: Default::default(), }, diff --git a/parachain/src/chain_spec/snowbridge.rs b/parachain/src/chain_spec/snowbridge.rs index f9d67c792365a..89d12a55eb3a4 100644 --- a/parachain/src/chain_spec/snowbridge.rs +++ b/parachain/src/chain_spec/snowbridge.rs @@ -120,10 +120,6 @@ fn testnet_genesis( }, asset_registry: snowbridge_runtime::AssetRegistryConfig { next_asset_id: 1 }, xcm_support: snowbridge_runtime::XcmSupportConfig {}, - ethereum_light_client: snowbridge_runtime::EthereumLightClientConfig { - initial_header: Default::default(), - initial_difficulty: Default::default(), - }, ethereum_beacon_client: snowbridge_runtime::EthereumBeaconClientConfig { initial_sync: Default::default(), }, diff --git a/test/scripts/helpers/mutateSpec.js b/test/scripts/helpers/mutateSpec.js index 558f2afbf744b..f31958e3d9395 100644 --- a/test/scripts/helpers/mutateSpec.js +++ b/test/scripts/helpers/mutateSpec.js @@ -16,13 +16,10 @@ function run() { rl.on('close', function() { data = JSON.parse(buffer); - let header = JSON.parse(fs.readFileSync(process.argv[2])); - let contracts = JSON.parse(fs.readFileSync(process.argv[3])); - let initialSync = JSON.parse(fs.readFileSync(process.argv[4])); + let contracts = JSON.parse(fs.readFileSync(process.argv[2])); + let initialSync = JSON.parse(fs.readFileSync(process.argv[3])); data['genesis']['runtime']['ethereumBeaconClient']['initialSync'] = initialSync; - data['genesis']['runtime']['ethereumLightClient']['initialHeader'] = header; - data['genesis']['runtime']['ethereumLightClient']['initialDifficulty'] = "0x0"; data['genesis']['runtime']['parachainInfo']['parachainId'] = 1000; data['para_id'] = 1000; diff --git a/test/scripts/start-services.sh b/test/scripts/start-services.sh index fe53cbecfd775..e229e04487cd6 100755 --- a/test/scripts/start-services.sh +++ b/test/scripts/start-services.sh @@ -139,13 +139,6 @@ start_polkadot_launch() echo "Generating chain specification" "$parachain_bin" build-spec --chain "$runtime" --disable-default-bootnode > "$output_dir/spec.json" - echo "Updating chain specification" - curl $infura_endpoint_http \ - -X POST \ - -H "Content-Type: application/json" \ - -d '{"jsonrpc":"2.0","method":"eth_getBlockByNumber","params": ["latest", false],"id":1}' \ - | node scripts/helpers/transformEthHeader.js > "$output_dir/initialHeader.json" - initial_beacon_block=$(curl "$beacon_endpoint_http/eth/v1/beacon/states/head/finality_checkpoints" \ | jq -r '.data.finalized.root') @@ -162,7 +155,7 @@ start_polkadot_launch() "$output_dir/initialBeaconSync_tmp.json" \ > "$output_dir/initialBeaconSync.json" - cat "$output_dir/spec.json" | node scripts/helpers/mutateSpec.js "$output_dir/initialHeader.json" "$output_dir/contracts.json" "$output_dir/initialBeaconSync.json" | sponge "$output_dir/spec.json" + cat "$output_dir/spec.json" | node scripts/helpers/mutateSpec.js "$output_dir/contracts.json" "$output_dir/initialBeaconSync.json" | sponge "$output_dir/spec.json" # TODO: add back # if [[ -n "${TEST_MALICIOUS_APP+x}" ]]; then