From 712f2309a67f100e47f515ce17aa9b00871e4942 Mon Sep 17 00:00:00 2001 From: Aidan Musnitzky Date: Thu, 10 Jun 2021 16:50:43 +0000 Subject: [PATCH 1/4] run 2 parachains for xcm testing --- parachain/config.json | 23 +++++++++++++++++++++++ test/config/launchConfigOverrides.json | 14 ++++++++++++++ test/scripts/start-services.sh | 12 +++++++++++- 3 files changed, 48 insertions(+), 1 deletion(-) diff --git a/parachain/config.json b/parachain/config.json index a488bcb856..cb428441dd 100644 --- a/parachain/config.json +++ b/parachain/config.json @@ -20,6 +20,15 @@ "--enable-offchain-indexing=true", "--offchain-worker=Always" ] + }, + { + "name": "eve", + "wsPort": 9956, + "port": 30556, + "flags": [ + "--enable-offchain-indexing=true", + "--offchain-worker=Always" + ] } ] }, @@ -37,6 +46,20 @@ "--", "--execution=wasm" ] + }, + { + "bin": "target/release/artemis", + "id": "201", + "wsPort": 9967, + "port": 30667, + "flags": [ + "-lbasic_authorship=trace,commitments=debug,import_header=trace,runtime=debug,submit_messages=trace", + "--rpc-port=9981", + "--offchain-worker=Always", + "--enable-offchain-indexing=true", + "--", + "--execution=wasm" + ] } ], "simpleParachains": [], diff --git a/test/config/launchConfigOverrides.json b/test/config/launchConfigOverrides.json index c5f335b728..beee43ccd4 100644 --- a/test/config/launchConfigOverrides.json +++ b/test/config/launchConfigOverrides.json @@ -13,6 +13,20 @@ "--", "--execution=wasm" ] + }, + { + "id": "201", + "wsPort": 11145, + "port": 31201, + "flags": [ + "--execution=native", + "-lruntime=debug,import_header=trace,bridge=trace", + "--rpc-cors=all", + "--offchain-worker=Always", + "--enable-offchain-indexing=true", + "--", + "--execution=wasm" + ] } ] } diff --git a/test/scripts/start-services.sh b/test/scripts/start-services.sh index 682f2b4fa5..ba19740de8 100755 --- a/test/scripts/start-services.sh +++ b/test/scripts/start-services.sh @@ -67,9 +67,12 @@ start_parachain() cargo build --release --no-default-features --features with-local-runtime - echo "Generating Parachain spec" + echo "Generating Parachain 1 spec" target/release/artemis build-spec --disable-default-bootnode > $configdir/spec.json + echo "Generating Parachain 2 spec" + target/release/artemis build-spec --disable-default-bootnode > $configdir/spec2.json + echo "Inserting Ganache chain info into genesis spec" ethereum_initial_header=$(curl http://localhost:8545 \ -X POST \ @@ -81,6 +84,11 @@ start_parachain() genesis.runtime.verifierLightclient.initialHeader "$ethereum_initial_header" \ genesis.runtime.parachainInfo.parachainId 200 \ para_id 200 + node ../test/scripts/helpers/overrideParachainSpec.js $configdir/spec2.json \ + genesis.runtime.verifierLightclient.initialDifficulty 0x0 \ + genesis.runtime.verifierLightclient.initialHeader "$ethereum_initial_header" \ + genesis.runtime.parachainInfo.parachainId 201 \ + para_id 201 echo "Writing Polkadot configuration" polkadotbinary=/tmp/polkadot/target/release/polkadot @@ -90,6 +98,8 @@ start_parachain() jq -s '.[0] * .[1]' config.json ../test/config/launchConfigOverrides.json \ | jq ".parachains[0].bin = \"$bin\"" \ | jq ".parachains[0].chain = \"$configdir/spec.json\"" \ + | jq ".parachains[1].bin = \"$bin\"" \ + | jq ".parachains[1].chain = \"$configdir/spec2.json\"" \ | jq ".relaychain.bin = \"$polkadotbinary\"" \ > $configdir/polkadotLaunchConfig.json From 0e5c60467b98476fde57e97e9055c81fa68b0a66 Mon Sep 17 00:00:00 2001 From: Aidan Musnitzky Date: Tue, 15 Jun 2021 22:21:05 +0000 Subject: [PATCH 2/4] make dup seperate --- parachain/config-dup.json | 699 ++++++++++++++++++++++ parachain/config.json | 23 - test/config/launchConfigOverrides.json | 14 - test/config/launchConfigOverridesDup.json | 32 + 4 files changed, 731 insertions(+), 37 deletions(-) create mode 100644 parachain/config-dup.json create mode 100644 test/config/launchConfigOverridesDup.json diff --git a/parachain/config-dup.json b/parachain/config-dup.json new file mode 100644 index 0000000000..cb428441dd --- /dev/null +++ b/parachain/config-dup.json @@ -0,0 +1,699 @@ +{ + "relaychain": { + "bin": "/tmp/polkadot/target/release/polkadot", + "chain": "rococo-local", + "nodes": [ + { + "name": "alice", + "wsPort": 9944, + "port": 30444, + "flags": [ + "--enable-offchain-indexing=true", + "--offchain-worker=Always" + ] + }, + { + "name": "bob", + "wsPort": 9955, + "port": 30555, + "flags": [ + "--enable-offchain-indexing=true", + "--offchain-worker=Always" + ] + }, + { + "name": "eve", + "wsPort": 9956, + "port": 30556, + "flags": [ + "--enable-offchain-indexing=true", + "--offchain-worker=Always" + ] + } + ] + }, + "parachains": [ + { + "bin": "target/release/artemis", + "id": "200", + "wsPort": 9966, + "port": 30666, + "flags": [ + "-lbasic_authorship=trace,commitments=debug,import_header=trace,runtime=debug,submit_messages=trace", + "--rpc-port=9980", + "--offchain-worker=Always", + "--enable-offchain-indexing=true", + "--", + "--execution=wasm" + ] + }, + { + "bin": "target/release/artemis", + "id": "201", + "wsPort": 9967, + "port": 30667, + "flags": [ + "-lbasic_authorship=trace,commitments=debug,import_header=trace,runtime=debug,submit_messages=trace", + "--rpc-port=9981", + "--offchain-worker=Always", + "--enable-offchain-indexing=true", + "--", + "--execution=wasm" + ] + } + ], + "simpleParachains": [], + "hrmpChannels": [], + "types": { + "HrmpChannel": { + "maxCapacity": "u32", + "maxTotalSize": "u32", + "maxMessageSize": "u32", + "msgCount": "u32", + "totalSize": "u32", + "mqcHead": "Option", + "senderDeposit": "Balance", + "recipientDeposit": "Balance" + }, + "HrmpChannelId": { + "sender": "u32", + "receiver": "u32" + }, + "HrmpOpenChannelRequest": { + "confirmed": "bool", + "age": "SessionIndex", + "senderDeposit": "Balance", + "maxMessageSize": "u32", + "maxCapacity": "u32", + "maxTotalSize": "u32" + }, + "ParachainProposal": { + "proposer": "AccountId", + "genesisHead": "HeadData", + "validators": "Vec", + "name": "Bytes", + "balance": "Balance" + }, + "RegisteredParachainInfo": { + "validators": "Vec", + "proposer": "AccountId" + }, + "ServiceQuality": { + "_enum": [ + "Ordered", + "Fast" + ] + }, + "AbridgedCandidateReceipt": { + "parachainIndex": "ParaId", + "relayParent": "Hash", + "headData": "HeadData", + "collator": "CollatorId", + "signature": "CollatorSignature", + "povBlockHash": "Hash", + "commitments": "CandidateCommitments" + }, + "AbridgedHostConfiguration": { + "maxCodeSize": "u32", + "maxHeadDataSize": "u32", + "maxUpwardQueueCount": "u32", + "maxUpwardQueueSize": "u32", + "maxUpwardMessageSize": "u32", + "maxUpwardMessageNumPerCandidate": "u32", + "hrmpMaxMessageNumPerCandidate": "u32", + "validationUpgradeFrequency": "BlockNumber", + "validationUpgradeDelay": "BlockNumber" + }, + "AbridgedHrmpChannel": { + "maxCapacity": "u32", + "maxTotalSize": "u32", + "maxMessageSize": "u32", + "msgCount": "u32", + "totalSize": "u32", + "mqcHead": "Option" + }, + "AssignmentId": "AccountId", + "AssignmentKind": { + "_enum": { + "Parachain": "Null", + "Parathread": "(CollatorId, u32)" + } + }, + "AttestedCandidate": { + "candidate": "AbridgedCandidateReceipt", + "validityVotes": "Vec", + "validatorIndices": "BitVec" + }, + "AuthorityDiscoveryId": "AccountId", + "AvailabilityBitfield": "BitVec", + "AvailabilityBitfieldRecord": { + "bitfield": "AvailabilityBitfield", + "submittedTt": "BlockNumber" + }, + "BackedCandidate": { + "candidate": "CommittedCandidateReceipt", + "validityVotes": "Vec", + "validatorIndices": "BitVec" + }, + "BufferedSessionChange": { + "applyAt": "BlockNumber", + "validators": "Vec", + "queued": "Vec", + "sessionIndex": "SessionIndex" + }, + "CandidateCommitments": { + "upwardMessages": "Vec", + "horizontalMessages": "Vec", + "newValidationCode": "Option", + "headData": "HeadData", + "processedDownwardMessages": "u32", + "hrmpWatermark": "BlockNumber" + }, + "CandidateDescriptor": { + "paraId": "ParaId", + "relayParent": "RelayChainHash", + "collatorId": "CollatorId", + "persistedValidationDataHash": "Hash", + "povHash": "Hash", + "erasureRoot": "Hash", + "signature": "CollatorSignature", + "paraHead": "Hash", + "validationCodeHash": "Hash" + }, + "CandidateHash": "Hash", + "CandidatePendingAvailability": { + "core": "CoreIndex", + "hash": "CandidateHash", + "descriptor": "CandidateDescriptor", + "availabilityVotes": "BitVec", + "backers": "BitVec", + "relayParentNumber": "BlockNumber", + "backedInNumber": "BlockNumber" + }, + "CandidateReceipt": { + "descriptor": "CandidateDescriptor", + "commitmentsHash": "Hash" + }, + "GlobalValidationData": { + "maxCodeSize": "u32", + "maxHeadDataSize": "u32", + "blockNumber": "BlockNumber" + }, + "CollatorId": "H256", + "CollatorSignature": "Signature", + "CommittedCandidateReceipt": { + "descriptor": "CandidateDescriptor", + "commitments": "CandidateCommitments" + }, + "CoreAssignment": { + "core": "CoreIndex", + "paraId": "ParaId", + "kind": "AssignmentKind", + "groupIdx": "GroupIndex" + }, + "CoreIndex": "u32", + "CoreOccupied": { + "_enum": { + "Parathread": "ParathreadEntry", + "Parachain": "Null" + } + }, + "DisputeStatementSet": { + "candidateHash": "CandidateHash", + "session": "SessionIndex", + "statements": "Vec<(DisputeStatement, ValidatorIndex, ValidatorSignature)>" + }, + "MultiDisputeStatementSet": "Vec", + "DisputeStatement": { + "_enum": { + "Valid": "ValidDisputeStatementKind", + "Invalid": "InvalidDisputeStatementKind" + } + }, + "ValidDisputeStatementKind": { + "_enum": [ + "Explicit", + "BackingSeconded", + "BackingValid", + "ApprovalChecking" + ] + }, + "InvalidDisputeStatementKind": { + "_enum": [ + "Explicit" + ] + }, + "ExplicitDisputeStatement": { + "valid": "bool", + "candidateHash": "CandidateHash", + "session": "SessionIndex" + }, + "DoubleVoteReport": { + "identity": "ValidatorId", + "first": "(Statement, ValidatorSignature)", + "second": "(Statement, ValidatorSignature)", + "proof": "MembershipProof", + "signingContext": "SigningContext" + }, + "DownwardMessage": "Bytes", + "GroupIndex": "u32", + "GlobalValidationSchedule": { + "maxCodeSize": "u32", + "maxHeadDataSize": "u32", + "blockNumber": "BlockNumber" + }, + "HeadData": "Bytes", + "HostConfiguration": { + "maxCodeSize": "u32", + "maxHeadDataSize": "u32", + "maxUpwardQueueCount": "u32", + "maxUpwardQueueSize": "u32", + "maxUpwardMessageSize": "u32", + "maxUpwardMessageNumPerCandidate": "u32", + "hrmpMaxMessageNumPerCandidate": "u32", + "validationUpgradeFrequency": "BlockNumber", + "validationUpgradeDelay": "BlockNumber", + "maxPovSize": "u32", + "maxDownwardMessageSize": "u32", + "preferredDispatchableUpwardMessagesStepWeight": "Weight", + "hrmpMaxParachainOutboundChannels": "u32", + "hrmpMaxParathreadOutboundChannels": "u32", + "hrmpOpenRequestTtl": "u32", + "hrmpSenderDeposit": "Balance", + "hrmpRecipientDeposit": "Balance", + "hrmpChannelMaxCapacity": "u32", + "hrmpChannelMaxTotalSize": "u32", + "hrmpMaxParachainInboundChannels": "u32", + "hrmpMaxParathreadInboundChannels": "u32", + "hrmpChannelMaxMessageSize": "u32", + "acceptancePeriod": "BlockNumber", + "parathreadCores": "u32", + "parathreadRetries": "u32", + "groupRotationFrequency": "BlockNumber", + "chainAvailabilityPeriod": "BlockNumber", + "threadAvailabilityPeriod": "BlockNumber", + "schedulingLookahead": "u32", + "maxValidatorsPerCore": "Option", + "maxValidators": "Option", + "disputePeriod": "SessionIndex", + "noShowSlots": "u32", + "nDelayTranches": "u32", + "zerothDelayTrancheWidth": "u32", + "neededApprovals": "u32", + "relayVrfModuloSamples": "u32" + }, + "InboundDownwardMessage": { + "pubSentAt": "BlockNumber", + "pubMsg": "DownwardMessage" + }, + "InboundHrmpMessage": { + "sentAt": "BlockNumber", + "data": "Bytes" + }, + "InboundHrmpMessages": "Vec", + "LocalValidationData": { + "parentHead": "HeadData", + "balance": "Balance", + "codeUpgradeAllowed": "Option" + }, + "MessageIngestionType": { + "downwardMessages": "Vec", + "horizontalMessages": "BTreeMap" + }, + "MessageQueueChain": "RelayChainHash", + "OutboundHrmpMessage": { + "recipient": "u32", + "data": "Bytes" + }, + "ParachainDispatchOrigin": { + "_enum": [ + "Signed", + "Parachain", + "Root" + ] + }, + "ParachainInherentData": { + "validationData": "PersistedValidationData", + "relayChainState": "StorageProof", + "downwardMessages": "Vec", + "horizontalMessages": "BTreeMap" + }, + "ParachainsInherentData": { + "bitfields": "SignedAvailabilityBitfields", + "backedCandidates": "Vec", + "disputes": "MultiDisputeStatementSet", + "parentHeader": "Header" + }, + "ParaGenesisArgs": { + "genesisHead": "Bytes", + "validationCode": "Bytes", + "parachain": "bool" + }, + "ParaId": "u32", + "ParaInfo": { + "manager": "AccountId", + "deposit": "Balance", + "locked": "bool" + }, + "ParaLifecycle": { + "_enum": [ + "Onboarding", + "Parathread", + "Parachain", + "UpgradingToParachain", + "DowngradingToParathread", + "OutgoingParathread", + "OutgoingParachain" + ] + }, + "ParaPastCodeMeta": { + "upgradeTimes": "Vec", + "lastPruned": "Option" + }, + "ParaScheduling": { + "_enum": [ + "Always", + "Dynamic" + ] + }, + "ParathreadClaim": "(ParaId, CollatorId)", + "ParathreadClaimQueue": { + "queue": "Vec", + "nextCoreOffset": "u32" + }, + "ParathreadEntry": { + "claim": "ParathreadClaim", + "retries": "u32" + }, + "ParaValidatorIndex": "u32", + "PersistedValidationData": { + "parentHead": "HeadData", + "relayParentNumber": "RelayChainBlockNumber", + "relayParentStorageRoot": "Hash", + "maxPovSize": "u32" + }, + "RelayChainBlockNumber": "u32", + "RelayChainHash": "Hash", + "QueuedParathread": { + "claim": "ParathreadEntry", + "coreOffset": "u32" + }, + "Remark": "[u8; 32]", + "Retriable": { + "_enum": { + "Never": "Null", + "WithRetries": "u32" + } + }, + "Scheduling": { + "_enum": [ + "Always", + "Dynamic" + ] + }, + "SessionInfo": { + "validators": "Vec", + "discoveryKeys": "Vec", + "assignmentKeys": "Vec", + "validatorGroups": "Vec", + "nCores": "u32", + "zerothDelayTrancheWidth": "u32", + "relayVrfModuloSamples": "u32", + "nDelayTranches": "u32", + "noShowSlots": "u32", + "neededApprovals": "u32" + }, + "SessionInfoValidatorGroup": "Vec", + "SignedAvailabilityBitfield": { + "payload": "BitVec", + "validatorIndex": "ParaValidatorIndex", + "signature": "ValidatorSignature" + }, + "SignedAvailabilityBitfields": "Vec", + "SigningContext": { + "sessionIndex": "SessionIndex", + "parentHash": "Hash" + }, + "Statement": { + "_enum": { + "Never": "Null", + "Candidate": "Hash", + "Valid": "Hash", + "Invalid": "Hash" + } + }, + "TransientValidationData": { + "maxCodeSize": "u32", + "maxHeadDataSize": "u32", + "balance": "Balance", + "codeUpgradeAllowed": "Option", + "dmqLength": "u32" + }, + "UpwardMessage": "Bytes", + "ValidationFunctionParams": { + "maxCodeSize": "u32", + "relayChainHeight": "RelayChainBlockNumber", + "codeUpgradeAllowed": "Option" + }, + "ValidationCode": "Bytes", + "ValidationData": { + "persisted": "PersistedValidationData", + "transient": "TransientValidationData" + }, + "ValidationDataType": { + "validationData": "ValidationData", + "relayChainState": "Vec" + }, + "ValidatorSignature": "Signature", + "ValidityAttestation": { + "_enum": { + "Never": "Null", + "Implicit": "ValidatorSignature", + "Explicit": "ValidatorSignature" + } + }, + "VersionedXcm": { + "_enum": { + "V0": "Xcm" + } + }, + "WithdrawAsset": { + "assets": "Vec", + "effects": "Vec" + }, + "ReserveAssetDeposit": { + "assets": "Vec", + "effects": "Vec" + }, + "TeleportAsset": { + "assets": "Vec", + "effects": "Vec" + }, + "Balances": { + "queryId": "Compact", + "assets": "Vec" + }, + "Transact": { + "originType": "OriginKind", + "call": "Vec" + }, + "RelayTo": { + "dest": "MultiLocation", + "inner": "VersionedXcm" + }, + "RelayedFrom": { + "superorigin": "MultiLocation", + "inner": "VersionedXcm" + }, + "Xcm": { + "_enum": { + "WithdrawAsset": "WithdrawAsset", + "ReserveAssetDeposit": "ReserveAssetDeposit", + "TeleportAsset": "TeleportAsset", + "Balances": "Balances", + "Transact": "Transact", + "RelayTo": "RelayTo", + "RelayedFrom": "RelayedFrom" + } + }, + "XcmError": { + "_enum": [ + "Undefined", + "Unimplemented", + "UnhandledXcmVersion", + "UnhandledXcmMessage", + "UnhandledEffect", + "EscalationOfPrivilege", + "UntrustedReserveLocation", + "UntrustedTeleportLocation", + "DestinationBufferOverflow", + "CannotReachDestination", + "MultiLocationFull", + "FailedToDecode", + "BadOrigin" + ] + }, + "XcmResult": { + "_enum": { + "Ok": "()", + "Err": "XcmError" + } + }, + "OriginKind": { + "_enum": [ + "Native", + "SovereignAccount", + "Superuser" + ] + }, + "NetworkId": { + "_enum": { + "Any": "Null", + "Named": "Vec", + "Polkadot": "Null", + "Kusama": "Null" + } + }, + "MultiLocation": { + "_enum": { + "Null": "Null", + "X1": "Junction", + "X2": "(Junction, Junction)", + "X3": "(Junction, Junction, Junction)", + "X4": "(Junction, Junction, Junction, Junction)", + "X5": "(Junction, Junction, Junction, Junction, Junction)", + "X6": "(Junction, Junction, Junction, Junction, Junction, Junction)", + "X7": "(Junction, Junction, Junction, Junction, Junction, Junction, Junction)", + "X8": "(Junction, Junction, Junction, Junction, Junction, Junction, Junction, Junction)" + } + }, + "AccountId32Junction": { + "network": "NetworkId", + "id": "AccountId" + }, + "AccountIndex64Junction": { + "network": "NetworkId", + "index": "Compact" + }, + "AccountKey20Junction": { + "network": "NetworkId", + "index": "[u8; 20]" + }, + "Junction": { + "_enum": { + "Parent": "Null", + "Parachain": "Compact", + "AccountId32": "AccountId32Junction", + "AccountIndex64": "AccountIndex64Junction", + "AccountKey20": "AccountKey20Junction", + "PalletInstance": "u8", + "GeneralIndex": "Compact", + "GeneralKey": "Vec", + "OnlyChild": "Null" + } + }, + "VersionedMultiLocation": { + "_enum": { + "V0": "MultiLocation" + } + }, + "AssetInstance": { + "_enum": { + "Undefined": "Null", + "Index8": "u8", + "Index16": "Compact", + "Index32": "Compact", + "Index64": "Compact", + "Index128": "Compact", + "Array4": "[u8; 4]", + "Array8": "[u8; 8]", + "Array16": "[u8; 16]", + "Array32": "[u8; 32]", + "Blob": "Vec" + } + }, + "AbstractFungible": { + "id": "Vec", + "instance": "Compact" + }, + "AbstractNonFungible": { + "class": "Vec", + "instance": "AssetInstance" + }, + "ConcreteFungible": { + "id": "MultiLocation", + "amount": "Compact" + }, + "ConcreteNonFungible": { + "class": "MultiLocation", + "instance": "AssetInstance" + }, + "MultiAsset": { + "_enum": { + "None": "Null", + "All": "Null", + "AllFungible": "Null", + "AllNonFungible": "Null", + "AllAbstractFungible": "Vec", + "AllAbstractNonFungible": "Vec", + "AllConcreteFungible": "MultiLocation", + "AllConcreteNonFungible": "MultiLocation", + "AbstractFungible": "AbstractFungible", + "AbstractNonFungible": "AbstractNonFungible", + "ConcreteFungible": "ConcreteFungible", + "ConcreteNonFungible": "ConcreteNonFungible" + } + }, + "VersionedMultiAsset": { + "_enum": { + "V0": "MultiAsset" + } + }, + "DepositAsset": { + "assets": "Vec", + "dest": "MultiLocation" + }, + "DepositReserveAsset": { + "assets": "Vec", + "dest": "MultiLocation", + "effects": "Vec" + }, + "ExchangeAsset": { + "give": "Vec", + "receive": "Vec" + }, + "InitiateReserveWithdraw": { + "assets": "Vec", + "reserve": "MultiLocation", + "effects": "Vec" + }, + "InitiateTeleport": { + "assets": "Vec", + "dest": "MultiLocation", + "effects": "Vec" + }, + "QueryHolding": { + "queryId": "Compact", + "dest": "MultiLocation", + "assets": "Vec" + }, + "Order": { + "_enum": { + "Null": "Null", + "DepositAsset": "DepositAsset", + "DepositReserveAsset": "DepositReserveAsset", + "ExchangeAsset": "ExchangeAsset", + "InitiateReserveWithdraw": "InitiateReserveWithdraw", + "InitiateTeleport": "InitiateTeleport", + "QueryHolding": "QueryHolding" + } + }, + "MessagingStateSnapshot": { + "relayDispatchQueueSize": "(u32, u32)", + "egressChannels": "Vec" + }, + "MessagingStateSnapshotEgressEntry": "(ParaId, AbridgedHrmpChannel)", + "SystemInherentData": "ParachainInherentData", + "VecInboundHrmpMessage": "Vec" + } +} diff --git a/parachain/config.json b/parachain/config.json index cb428441dd..a488bcb856 100644 --- a/parachain/config.json +++ b/parachain/config.json @@ -20,15 +20,6 @@ "--enable-offchain-indexing=true", "--offchain-worker=Always" ] - }, - { - "name": "eve", - "wsPort": 9956, - "port": 30556, - "flags": [ - "--enable-offchain-indexing=true", - "--offchain-worker=Always" - ] } ] }, @@ -46,20 +37,6 @@ "--", "--execution=wasm" ] - }, - { - "bin": "target/release/artemis", - "id": "201", - "wsPort": 9967, - "port": 30667, - "flags": [ - "-lbasic_authorship=trace,commitments=debug,import_header=trace,runtime=debug,submit_messages=trace", - "--rpc-port=9981", - "--offchain-worker=Always", - "--enable-offchain-indexing=true", - "--", - "--execution=wasm" - ] } ], "simpleParachains": [], diff --git a/test/config/launchConfigOverrides.json b/test/config/launchConfigOverrides.json index beee43ccd4..c5f335b728 100644 --- a/test/config/launchConfigOverrides.json +++ b/test/config/launchConfigOverrides.json @@ -13,20 +13,6 @@ "--", "--execution=wasm" ] - }, - { - "id": "201", - "wsPort": 11145, - "port": 31201, - "flags": [ - "--execution=native", - "-lruntime=debug,import_header=trace,bridge=trace", - "--rpc-cors=all", - "--offchain-worker=Always", - "--enable-offchain-indexing=true", - "--", - "--execution=wasm" - ] } ] } diff --git a/test/config/launchConfigOverridesDup.json b/test/config/launchConfigOverridesDup.json new file mode 100644 index 0000000000..beee43ccd4 --- /dev/null +++ b/test/config/launchConfigOverridesDup.json @@ -0,0 +1,32 @@ +{ + "parachains": [ + { + "id": "200", + "wsPort": 11144, + "port": 31200, + "flags": [ + "--execution=native", + "-lruntime=debug,import_header=trace,bridge=trace", + "--rpc-cors=all", + "--offchain-worker=Always", + "--enable-offchain-indexing=true", + "--", + "--execution=wasm" + ] + }, + { + "id": "201", + "wsPort": 11145, + "port": 31201, + "flags": [ + "--execution=native", + "-lruntime=debug,import_header=trace,bridge=trace", + "--rpc-cors=all", + "--offchain-worker=Always", + "--enable-offchain-indexing=true", + "--", + "--execution=wasm" + ] + } + ] +} From e71a835dac4e9c565ad5afad76db4f9baa4ebfe1 Mon Sep 17 00:00:00 2001 From: Aidan Musnitzky Date: Tue, 15 Jun 2021 22:50:08 +0000 Subject: [PATCH 3/4] make dup in single script --- test/scripts/start-services.sh | 53 ++++++++++++++++++++++------------ 1 file changed, 34 insertions(+), 19 deletions(-) diff --git a/test/scripts/start-services.sh b/test/scripts/start-services.sh index ba19740de8..61fa22b26b 100755 --- a/test/scripts/start-services.sh +++ b/test/scripts/start-services.sh @@ -59,20 +59,17 @@ deploy_contracts() } -start_parachain() +start_polkadot_launch() { - echo "Starting Parachain" + echo "Building parachain and starting polkadot launch" pushd ../parachain bin=$(pwd)/target/release/artemis cargo build --release --no-default-features --features with-local-runtime - echo "Generating Parachain 1 spec" + echo "Generating Parachain spec" target/release/artemis build-spec --disable-default-bootnode > $configdir/spec.json - echo "Generating Parachain 2 spec" - target/release/artemis build-spec --disable-default-bootnode > $configdir/spec2.json - echo "Inserting Ganache chain info into genesis spec" ethereum_initial_header=$(curl http://localhost:8545 \ -X POST \ @@ -84,24 +81,37 @@ start_parachain() genesis.runtime.verifierLightclient.initialHeader "$ethereum_initial_header" \ genesis.runtime.parachainInfo.parachainId 200 \ para_id 200 - node ../test/scripts/helpers/overrideParachainSpec.js $configdir/spec2.json \ - genesis.runtime.verifierLightclient.initialDifficulty 0x0 \ - genesis.runtime.verifierLightclient.initialHeader "$ethereum_initial_header" \ - genesis.runtime.parachainInfo.parachainId 201 \ - para_id 201 echo "Writing Polkadot configuration" polkadotbinary=/tmp/polkadot/target/release/polkadot if [[ -f ../test/.env ]]; then source ../test/.env fi - jq -s '.[0] * .[1]' config.json ../test/config/launchConfigOverrides.json \ - | jq ".parachains[0].bin = \"$bin\"" \ - | jq ".parachains[0].chain = \"$configdir/spec.json\"" \ - | jq ".parachains[1].bin = \"$bin\"" \ - | jq ".parachains[1].chain = \"$configdir/spec2.json\"" \ - | jq ".relaychain.bin = \"$polkadotbinary\"" \ - > $configdir/polkadotLaunchConfig.json + + if [ $# -eq 1 ] && [ $1 = "duplicate" ]; + then + echo "Generating second parachain spec" + target/release/artemis build-spec --disable-default-bootnode > $configdir/spec2.json + + node ../test/scripts/helpers/overrideParachainSpec.js $configdir/spec2.json \ + genesis.runtime.verifierLightclient.initialDifficulty 0x0 \ + genesis.runtime.verifierLightclient.initialHeader "$ethereum_initial_header" \ + genesis.runtime.parachainInfo.parachainId 201 \ + para_id 201 + jq -s '.[0] * .[1]' configDup.json ../test/config/launchConfigOverridesDup.json \ + | jq ".parachains[0].bin = \"$bin\"" \ + | jq ".parachains[0].chain = \"$configdir/spec.json\"" \ + | jq ".parachains[1].bin = \"$bin\"" \ + | jq ".parachains[1].chain = \"$configdir/spec2.json\"" \ + | jq ".relaychain.bin = \"$polkadotbinary\"" \ + > $configdir/polkadotLaunchConfig.json + else + jq -s '.[0] * .[1]' config.json ../test/config/launchConfigOverrides.json \ + | jq ".parachains[0].bin = \"$bin\"" \ + | jq ".parachains[0].chain = \"$configdir/spec.json\"" \ + | jq ".relaychain.bin = \"$polkadotbinary\"" \ + > $configdir/polkadotLaunchConfig.json + fi polkadot-launch $configdir/polkadotLaunchConfig.json & @@ -139,7 +149,12 @@ trap cleanup SIGINT SIGTERM EXIT start_ganache deploy_contracts -start_parachain +if [ $# -eq 1 ] && [ $1 = "duplicate" ]; +then + start_polkadot_launch "duplicate" +else + start_polkadot_launch +fi restart_ganache echo "Waiting for consensus between polkadot and parachain" sleep 60 From 0118caa54132b96d1bcd25361649dbc6d68d9592 Mon Sep 17 00:00:00 2001 From: Aidan Musnitzky Date: Tue, 15 Jun 2021 22:54:52 +0000 Subject: [PATCH 4/4] fix and readme updates --- test/README.md | 4 ++-- test/scripts/start-services.sh | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/test/README.md b/test/README.md index 8e4620a096..e8ed04c421 100644 --- a/test/README.md +++ b/test/README.md @@ -63,10 +63,10 @@ Optional: If you cloned the polkadot repo in another location, Create an `.env` cp ./.env-example .env ``` -Start all services (parachain, relayer, ganache, etc): +Start all services (parachain, relayer, ganache, etc). We recommend adding the `duplicate` flag to create a duplicate parachain so that we have 2 different running and registered parachains for testing XCM and for testing the polkadot light client with multiple parachain headers being tracked. ```bash -scripts/start-services.sh +scripts/start-services.sh duplicate ``` Wait until the "System has been initialized" message diff --git a/test/scripts/start-services.sh b/test/scripts/start-services.sh index 61fa22b26b..4825da8d38 100755 --- a/test/scripts/start-services.sh +++ b/test/scripts/start-services.sh @@ -98,7 +98,7 @@ start_polkadot_launch() genesis.runtime.verifierLightclient.initialHeader "$ethereum_initial_header" \ genesis.runtime.parachainInfo.parachainId 201 \ para_id 201 - jq -s '.[0] * .[1]' configDup.json ../test/config/launchConfigOverridesDup.json \ + jq -s '.[0] * .[1]' config-dup.json ../test/config/launchConfigOverridesDup.json \ | jq ".parachains[0].bin = \"$bin\"" \ | jq ".parachains[0].chain = \"$configdir/spec.json\"" \ | jq ".parachains[1].bin = \"$bin\"" \