Skip to content
Open
Show file tree
Hide file tree
Changes from 2 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
6 changes: 5 additions & 1 deletion packages/dashmate/src/status/scopes/platform.js
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,11 @@ export default function getPlatformScopeFactory(
}

info.version = version;
info.protocolVersion = parseInt(tenderdashStatus.node_info.protocol_version.app, 10);
// node_info.protocol_version.app is snapshotted at Tenderdash process start and
// stays stale across in-process protocol upgrades. application_info.version is
// the live active/current app protocol version.
info.protocolVersion = parseInt(tenderdashStatus.application_info.version, 10);
// abci_info app_version reflects the installed software's desired/supported version.
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Outdated
info.desiredProtocolVersion = tenderdashAbciInfo.response.app_version;
info.listening = listening;
info.latestBlockHeight = latestBlockHeight;
Expand Down
13 changes: 12 additions & 1 deletion packages/dashmate/test/unit/status/scopes/platform.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,17 +78,22 @@ describe('getPlatformScopeFactory', () => {
mockDockerCompose.execCommand.withArgs(config, 'drive_abci', 'drive-abci version').resolves({ exitCode: 0, out: '1.4.1' });
mockMNOWatchProvider.returns(Promise.resolve('OPEN'));

// node_info.protocol_version.app can be stale after in-process upgrades;
// protocolVersion must come from application_info.version (live).
const mockStatus = {
node_info: {
protocol_version: {
p2p: '10',
block: '14',
app: '3',
app: '11',
},
version: '0',
network: 'test',
moniker: 'test',
},
application_info: {
version: '3',
},
sync_info: {
catching_up: false,
latest_app_hash: 'DEADBEEF',
Expand Down Expand Up @@ -182,6 +187,9 @@ describe('getPlatformScopeFactory', () => {
network: 'test',
moniker: 'test',
},
application_info: {
version: '3',
},
sync_info: {
catching_up: true,
latest_app_hash: 'DEADBEEF',
Expand Down Expand Up @@ -445,6 +453,9 @@ describe('getPlatformScopeFactory', () => {
network: 'test',
moniker: 'test',
},
application_info: {
version: '3',
},
sync_info: {
catching_up: false,
latest_app_hash: 'DEADBEEF',
Expand Down
Loading