Skip to content

Commit

Permalink
Merge branch 'v1.0-dev' into fix/expected-service-to-be-ip
Browse files Browse the repository at this point in the history
  • Loading branch information
shumkov authored Jul 19, 2024
2 parents 77626ee + 811817a commit eec9392
Show file tree
Hide file tree
Showing 6 changed files with 70 additions and 9 deletions.
6 changes: 6 additions & 0 deletions packages/dashmate/configs/defaults/getBaseConfigFactory.js
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,12 @@ export default function getBaseConfigFactory(homeDir) {
name: null,
minimumDifficultyBlocks: 0,
powTargetSpacing: 150,
llmq: {
chainLocks: 'llmq_devnet',
instantSend: 'llmq_devnet_dip0024',
platform: 'llmq_devnet_platform',
mnhf: 'llmq_devnet',
},
},
log: {
file: {
Expand Down
2 changes: 2 additions & 0 deletions packages/dashmate/configs/getConfigFileMigrationsFactory.js
Original file line number Diff line number Diff line change
Expand Up @@ -695,6 +695,8 @@ export default function getConfigFileMigrationsFactory(homeDir, defaultConfigs)
options.core.docker.image = getDefaultConfigByNameOrGroup(name, options.group)
.get('core.docker.image');

options.core.devnet.llmq = base.get('core.devnet.llmq');

if (options.network === NETWORK_TESTNET) {
options.platform.drive.tenderdash.genesis = testnet.get('platform.drive.tenderdash.genesis');
}
Expand Down
33 changes: 33 additions & 0 deletions packages/dashmate/src/config/configJsonSchema.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,20 @@ export default {
required: ['llmqType', 'dkgInterval', 'activeSigners', 'rotation'],
additionalProperties: false,
},
quorumName: {
type: 'string',
enum: [
'llmq_devnet',
'llmq_devnet_dip0024',
'llmq_devnet_platform',
'llmq_50_60',
'llmq_60_75',
'llmq_400_60',
'llmq_400_85',
'llmq_100_67',
'llmq_25_67',
],
},
},
properties: {
description: {
Expand Down Expand Up @@ -361,6 +375,25 @@ export default {
type: 'integer',
minimum: 1,
},
llmq: {
type: 'object',
properties: {
chainLocks: {
$ref: '#/definitions/quorumName',
},
instantSend: {
$ref: '#/definitions/quorumName',
},
platform: {
$ref: '#/definitions/quorumName',
},
mnhf: {
$ref: '#/definitions/quorumName',
},
},
required: ['chainLocks', 'instantSend', 'platform', 'mnhf'],
additionalProperties: false,
},
},
additionalProperties: false,
required: ['name', 'minimumDifficultyBlocks', 'powTargetSpacing'],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,11 @@ import generateTenderdashNodeKey from '../../tenderdash/generateTenderdashNodeKe
*/
export default function createPlatformNodeKeyInput(options = {}) {
let { initial } = options;
let additionalMessage = '';
if (initial === null || initial === undefined) {
initial = generateTenderdashNodeKey();
additionalMessage = ' You can provide a key, or a new key will be\n automatically generated'
+ ' for you.';
}

return {
Expand All @@ -19,8 +22,7 @@ export default function createPlatformNodeKeyInput(options = {}) {
This key is used to uniquely identify your Dash Platform node. The node key is
derived from a standard Ed25519 cryptographic key pair, presented in a cached
format specific to Tenderdash. You can provide a key, or a new key will be
automatically generated for you.\n`,
format specific to Tenderdash.${additionalMessage}\n`,
message: 'Enter Ed25519 node key',
hint: 'Base64 encoded',
initial,
Expand Down
8 changes: 4 additions & 4 deletions packages/dashmate/templates/core/dash.conf.dot
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,10 @@ powtargetspacing={{=it.core.devnet.powTargetSpacing}}
minimumdifficultyblocks={{=it.core.devnet.minimumDifficultyBlocks}}
highsubsidyblocks=500
highsubsidyfactor=10
llmqchainlocks=llmq_devnet
llmqinstantsend=llmq_devnet
llmqinstantsenddip0024=llmq_devnet_dip0024
llmqplatform=llmq_devnet_platform{{?}}
llmqchainlocks={{=it.core.devnet.llmq.chainLocks}}
llmqinstantsenddip0024={{=it.core.devnet.llmq.instantSend}}
llmqplatform={{=it.core.devnet.llmq.platform}}
llmqmnhf={{=it.core.devnet.llmq.mnhf}} {{?}}


{{~it.core.p2p.seeds :seed}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,27 @@ where
request,
)?;

// We get core height early, as this also verifies mn_rr fork
let core_height =
self.initial_core_height(request.initial_core_height, platform_version)?;
// Wait until we have an initial core height to start the chain
let core_height = loop {
match self.initial_core_height(request.initial_core_height, platform_version) {
Ok(height) => break height,
Err(e) => match e {
Error::Execution(ExecutionError::InitializationForkNotActive(_))
| Error::Execution(ExecutionError::InitializationBadCoreLockedHeight {
..
}) => {
tracing::warn!(
error = ?e,
"Failed to obtain deterministic initial core height to start the chain. Retrying in 30 seconds.",
);

// We need to wait for the fork to be active
std::thread::sleep(std::time::Duration::from_secs(30));
}
e => return Err(e),
},
}
};

let genesis_time = request.genesis_time;

Expand Down

0 comments on commit eec9392

Please sign in to comment.