Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion configs/karura.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,3 @@ parachains:
nodes:
- flags:
- --alice

11 changes: 11 additions & 0 deletions configs/kusama.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,17 @@ relaychain:
config:
validation_upgrade_frequency: 1
validation_upgrade_delay: 1
# enable hrmp channels after: https://github.com/paritytech/polkadot/pull/4324
# hrmp:
# preopenHrmpChannels:
# - sender: 2000
# recipient: 2001
# maxCapacity: 8
# maxMessageSize: 102400
# - sender: 2001
# recipient: 2000
# maxCapacity: 8
# maxMessageSize: 102400
env:
RUST_LOG: parachain::candidate-backing=trace,parachain::candidate-selection=trace,parachain::pvf=trace,parachain::collator-protocol=trace,parachain::provisioner=trace
flags:
Expand Down
10 changes: 10 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,16 @@ const generateRelaychainGenesisFile = (config: Config, path: string, output: str

// additional patches
if (config.relaychain.runtimeGenesisConfig) {
const hrmp = config.relaychain.runtimeGenesisConfig.hrmp;
if (hrmp) {
hrmp.preopenHrmpChannels = hrmp.preopenHrmpChannels.map((channel) => {
if (!Array.isArray(channel)) {
return [channel.sender, channel.recipient, channel.maxCapacity, channel.maxMessageSize];
} else {
return channel;
}
});
}
_.merge(runtime, config.relaychain.runtimeGenesisConfig);
}

Expand Down
12 changes: 12 additions & 0 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ export interface RelayChain {
nodes: Node[];
runtimeGenesisConfig: {
configuration: { config: { [index: string]: string | number } };
hrmp?: {
preopenHrmpChannels: HrmpChannelsConfig[];
};
};
}

Expand Down Expand Up @@ -68,3 +71,12 @@ export interface DockerNode {
};
};
}

export type HrmpChannelsConfig =
| {
sender: number;
recipient: number;
maxCapacity: number;
maxMessageSize: number;
}
| [number, number, number, number];