difftreelog
ci zombienet config + updated chainql files
in: master
3 files changed
.docker/forkless-config/fork.jsonnetdiffbeforeafterboth1// Get live chain data on the URL provided with `forkFrom`, and 2// insert the necessary data into a chain spec to launch a new chain with.3// 4// ### Arguments5// - `rawSpec`: Path to the raw chain spec to modify6// - `forkFrom`: URL of the chain's WS port to get the data from7// 8// ### Usage9// `chainql --tla-code=rawSpec="import 'parachain-spec-raw.json'" --tla-str=forkFrom="wss://some-parachain.node:443" fork.jsonnet`1102function(rawSpec, forkFrom)11function(rawSpec, forkFrom)3local sourceChain = cql.chain(forkFrom).latest;12local sourceChainState = cql.chain(forkFrom).latest;4135local raw = local sourceRaw = sourceChain._raw._preloadKeys; {14local raw = local sourceRaw = sourceChainState._raw._preloadKeys; {6 [key]: cql.toHex(sourceRaw[key])15 [key]: cql.toHex(sourceRaw[key])7 for key in std.objectFields(sourceRaw)16 for key in std.objectFields(sourceRaw)8 if sourceRaw[key] != null17 if sourceRaw[key] != null9};18};101911local typeNames = (import './typeNames.jsonnet')(sourceChain);1213local20local14auraKeys = [21auraKeys = [15 sourceChain.AuraExt._key.Authorities,22 sourceChainState.AuraExt._key.Authorities,16 sourceChain.Aura._key.Authorities,23 sourceChainState.Aura._key.Authorities,17] + (if 'CollatorSelection' in sourceChain then [24] + (if 'CollatorSelection' in sourceChainState then [18 sourceChain.CollatorSelection._key.Candidates,25 sourceChainState.CollatorSelection._key.Candidates,19 sourceChain.CollatorSelection._key.Invulnerables,26 sourceChainState.CollatorSelection._key.Invulnerables,20] else []),27] else []),212822// Keys, which should be migrated from passed spec, rather than from forked chain29// Keys, which should be migrated from passed spec, rather than from forked chain23wantedKeys = [30wantedKeys = [24 sourceChain.ParachainInfo._key.ParachainId,31 sourceChainState.ParachainInfo._key.ParachainId,25 sourceChain.Sudo._key.Key,32 sourceChainState.Sudo._key.Key,26 sourceChain.System.BlockHash._key['0'],33 sourceChainState.System.BlockHash._key['0'],27 // Always [69, 69, 69, ..., 69, 69, 69]34 // Always [69, 69, 69, ..., 69, 69, 69]28 sourceChain.System._key.ParentHash,35 sourceChainState.System._key.ParentHash,29] + auraKeys,36] + auraKeys,3031// Keys to remove from original chain37// Keys to remove from original chain32unwantedPrefixes = [38unwantedPrefixes = [33 sourceChain.Aura._key.CurrentSlot,39 sourceChainState.Aura._key.CurrentSlot,34 // Ensure there will be no panics caused by unexpected kept state40 // Ensure there will be no panics caused by unexpected kept state35 sourceChain.ParachainSystem._key.ValidationData,41 sourceChainState.ParachainSystem._key.ValidationData,36 sourceChain.ParachainSystem._key.RelayStateProof,42 sourceChainState.ParachainSystem._key.RelayStateProof,37 sourceChain.ParachainSystem._key.HostConfiguration,43 sourceChainState.ParachainSystem._key.HostConfiguration,38 sourceChain.ParachainSystem._key.LastRelayChainBlockNumber,44 sourceChainState.ParachainSystem._key.LastRelayChainBlockNumber,39 sourceChain.ParachainSystem._key.LastDmqMqcHead,45 sourceChainState.ParachainSystem._key.LastDmqMqcHead,40 // Part of head46 // Part of head41 sourceChain.System._key.BlockHash,47 sourceChainState.System._key.BlockHash,42 sourceChain.System._key.Number,48 sourceChainState.System._key.Number,43 sourceChain.System._key.Digest,49 sourceChainState.System._key.Digest,44] + auraKeys,50] + auraKeys,455146cleanupRaw(raw) = {52cleanupRaw(raw) = {62 },68 },63 },69 },64};70};7172local pow10(n) = std.foldl(function(a, _) a * std.bigint('10'), std.range(0, n), std.bigint('1'));657366local74local67 aliceAccount = sourceChain.System._encodeKey.Account(['0xd43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d']),75 aliceAccount = sourceChainState.System._encodeKey.Account(['0xd43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d']),68 totalIssuance = sourceChain.Balances._encodeKey.TotalIssuance([]),76 totalIssuance = sourceChainState.Balances._encodeKey.TotalIssuance([]),69 unique = cql.calc(["10", "18", "**"]),77 Munique = pow10(6 + 18),70 Munique = cql.calc([unique, "10", "6", "**", "*"]),71;78;727973outSpec {80outSpec {74 genesis+: {81 genesis+: {75 raw+: {82 raw+: {76 top+: {83 top+: {77 [totalIssuance]: sourceChain._encode(typeNames.u128, cql.calc([84 [totalIssuance]: sourceChainState.Balances._encodeValue.TotalIssuance(78 Munique,85 if std.objectHas(super, totalIssuance)79 if std.objectHas(super, totalIssuance) then sourceChain._decode(typeNames.u128, super[totalIssuance]) else '0',86 then sourceChainState.Balances._decodeValue.TotalIssuance(super[totalIssuance])87 else std.bigint(0)80 if std.objectHas(super, aliceAccount) then sourceChain._decode(typeNames.AccountInfo, super[aliceAccount]).data.free else '0',88 - if std.objectHas(super, aliceAccount)89 then sourceChainState.System._decodeValue.Account(super[aliceAccount]).data.free90 else std.bigint(0)81 '-', '+',91 + Munique82 ])),92 ),83 [aliceAccount]: sourceChain._encode(typeNames.AccountInfo, {93 [aliceAccount]: sourceChainState.System._encodeValue.Account({84 nonce: 0,94 nonce: 0,85 consumers: 3,95 consumers: 3,86 providers: 1,96 providers: 1,87 sufficients: 0,97 sufficients: 0,88 data: {98 data: {89 free: Munique,99 free: Munique,90 reserved: "0",100 reserved: std.bigint('0'),91 misc_frozen: "0",101 misc_frozen: std.bigint('0'),92 fee_frozen: "0",102 fee_frozen: std.bigint('0'),93 },103 },94 },)104 },)95 },105 },.docker/forkless-config/typeNames.jsonnetdiffbeforeafterbothno changes
.docker/forkless-config/zombienet-forkless-data.tomldiffbeforeafterbothno changes