diff --git a/bin/collator/src/parachain/chain_spec/astar.rs b/bin/collator/src/parachain/chain_spec/astar.rs index ef7b8cbdd5..9ea58108bc 100644 --- a/bin/collator/src/parachain/chain_spec/astar.rs +++ b/bin/collator/src/parachain/chain_spec/astar.rs @@ -141,6 +141,7 @@ fn make_genesis( // We need _some_ code inserted at the precompile address so that // the evm will actually call the address. accounts: Precompiles::used_addresses() + .filter(|addr| !Precompiles::is_blacklisted(addr)) .map(|addr| { ( addr, diff --git a/bin/collator/src/parachain/chain_spec/shiden.rs b/bin/collator/src/parachain/chain_spec/shiden.rs index a08b3a1446..2982f8ac60 100644 --- a/bin/collator/src/parachain/chain_spec/shiden.rs +++ b/bin/collator/src/parachain/chain_spec/shiden.rs @@ -142,6 +142,7 @@ fn make_genesis( // We need _some_ code inserted at the precompile address so that // the evm will actually call the address. accounts: Precompiles::used_addresses() + .filter(|addr| !Precompiles::is_blacklisted(addr)) .map(|addr| { ( addr, diff --git a/runtime/astar/src/precompiles.rs b/runtime/astar/src/precompiles.rs index cc0d81180e..6e9885facc 100644 --- a/runtime/astar/src/precompiles.rs +++ b/runtime/astar/src/precompiles.rs @@ -63,6 +63,13 @@ impl AstarNetworkPrecompiles { .into_iter() .map(hash) } + + /// Returns all addresses which are blacklisted for dummy code deployment. + /// This is in order to keep the local testnets consistent with the live network. + pub fn is_blacklisted(address: &H160) -> bool { + // `dispatch` precompile is not allowed to be called by smart contracts, hence the ommision of this address. + hash(1025) == *address + } } /// The following distribution has been decided for the precompiles diff --git a/runtime/shiden/src/precompiles.rs b/runtime/shiden/src/precompiles.rs index 62b1023e54..bc9a9de235 100644 --- a/runtime/shiden/src/precompiles.rs +++ b/runtime/shiden/src/precompiles.rs @@ -63,6 +63,13 @@ impl ShidenNetworkPrecompiles { .into_iter() .map(hash) } + + /// Returns all addresses which are blacklisted for dummy code deployment. + /// This is in order to keep the local testnets consistent with the live network. + pub fn is_blacklisted(address: &H160) -> bool { + // `dispatch` precompile is not allowed to be called by smart contracts, hence the ommision of this address. + hash(1025) == *address + } } /// The following distribution has been decided for the precompiles