git.delta.rocks / unique-network / refs/commits / c6aaa88ca965

difftreelog

source

.docker/forking/fork.jsonnet1.7 KiBsourcehistory
12function(rawSpec, forkFrom)3local sourceChain = cql.chain(forkFrom).latest;45local raw = local sourceRaw = sourceChain._raw._preloadKeys; {6  [key]: cql.toHex(sourceRaw[key])7  for key in std.objectFields(sourceRaw)8  if sourceRaw[key] != null9};1011local12auraKeys = [13	// AuraExt.Authorities, we don't have aura pallet enabled for some reason, to refer using cql api14	'0x3c311d57d4daf52904616cf69648081e5e0621c4869aa60c02be9adcc98a0d1d',15	// Aura.Authorities16	'0x57f8dc2f5ab09467896f47300f0424385e0621c4869aa60c02be9adcc98a0d1d',17],1819// Keys, which should be migrated from passed spec, rather than from forked chain20wantedKeys = [21	sourceChain.ParachainInfo._key.ParachainId,22	sourceChain.Sudo._key.Key,23	sourceChain.System.BlockHash._key['0'],24	sourceChain.System._key.ParentHash,25] + auraKeys,2627// Keys to remove from original chain28unwantedPrefixes = [29	// Aura.CurrentSlot30	'0x57f8dc2f5ab09467896f47300f04243806155b3cd9a8c9e5e9a23fd5dc13a5ed',31	// Ensure there will be no panics caused by unexpected kept state32	sourceChain.ParachainSystem._key.ValidationData,33	sourceChain.ParachainSystem._key.RelayStateProof,34	sourceChain.ParachainSystem._key.HostConfiguration,35	sourceChain.ParachainSystem._key.LastDmqMqcHead,36	// Part of head37	sourceChain.System._key.BlockHash,38	sourceChain.System._key.Number,39	sourceChain.System._key.Digest,40] + auraKeys,4142cleanupRaw(raw) = {43	[key]: raw[key]44	for key in std.objectFields(raw)45	if std.all(std.map(function(prefix) !std.startsWith(key, prefix), unwantedPrefixes))46};4748local originalRaw = rawSpec.genesis.raw.top;49local outSpec = rawSpec {50	genesis+: {51		raw+: {52			top: cleanupRaw(raw) {53				[key]: originalRaw[key]54				for key in wantedKeys55			},56		},57	},58};59outSpec