Skip to content

Commit

Permalink
Merge pull request #1272 from RunOnFlux/development
Browse files Browse the repository at this point in the history
v5.4.0
  • Loading branch information
TheTrunk authored Apr 9, 2024
2 parents 4ddeace + f23faf3 commit 51ea029
Show file tree
Hide file tree
Showing 17 changed files with 36 additions and 22 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
1 change: 1 addition & 0 deletions HomeUI/dist/js/321.js

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion HomeUI/dist/js/6280.js

This file was deleted.

1 change: 0 additions & 1 deletion HomeUI/dist/js/7356.js

This file was deleted.

1 change: 1 addition & 0 deletions HomeUI/dist/js/816.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion HomeUI/dist/js/7539.js → HomeUI/dist/js/9733.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion HomeUI/dist/js/9174.js → HomeUI/dist/js/9961.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion HomeUI/dist/js/index.js

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions HomeUI/src/views/apps/Management.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8175,6 +8175,9 @@ export default {
},
async checkFluxUpdateSpecificationsAndFormatMessage() {
try {
if (this.appRunningTill.new < this.appRunningTill.current) {
throw new Error('New subscription period cannot be lower than the current one.');
}
if (!this.tosAgreed) {
throw new Error('Please agree to Terms of Service');
}
Expand Down
7 changes: 5 additions & 2 deletions ZelBack/config/default.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,11 @@ module.exports = {
porttestnet: 26125,
rpcporttestnet: 26124,
},
minimumFluxBenchAllowedVersion: '3.9.0',
minimumFluxOSAllowedVersion: '4.20.0',
minimumFluxBenchAllowedVersion: '4.0.0',
minimumFluxOSAllowedVersion: '5.0.0',
fluxTeamZelId: '1hjy4bCYBJr4mny4zCE85J94RXa8W6q37',
deterministicNodesStart: 558000,
syncthingVersionCheckStart: 1630040, // block where we will start looking at a min. syncthing version installed. block expected on 26th of April 2024
fluxapps: {
// in flux main chain per month (blocksLasting)
price: [
Expand Down Expand Up @@ -204,6 +205,8 @@ module.exports = {
},
blocksLasting: 22000, // by default registered app will live for 22000 of blocks 44000 minutes ~= 1 month
minBlocksAllowance: 5000, // app can be registered for a minimum of this blocks ~ 1 week
newMinBlocksAllowance: 100, // app can be registered for a minimum of this blocks ~ 3 hours - to allow users to cancel application subscription
newMinBlocksAllowanceBlock: 1630040, // block where we will start looking at new min blocks allowance. block expected on 26th of April 2024
maxBlocksAllowance: 264000, // app can be registered up for a maximum of this blocks ~ 1 year
blocksAllowanceInterval: 1000, // ap differences can be in 1000s - more than 1 day
removeBlocksAllowanceIntervalBlock: 1625000, // after this block we can start having app updates without extending subscription - block expected in April 19th 2024
Expand Down
11 changes: 6 additions & 5 deletions ZelBack/src/services/appsService.js
Original file line number Diff line number Diff line change
Expand Up @@ -5526,8 +5526,12 @@ function verifyRestrictionCorrectnessOfApp(appSpecifications, height) {
}

if (appSpecifications.version >= 6) {
if (appSpecifications.expire < config.fluxapps.minBlocksAllowance) {
throw new Error(`Minimum expiration of application is ${config.fluxapps.minBlocksAllowance} blocks ~ 1 week`);
if (height < config.fluxapps.newMinBlocksAllowanceBlock) {
if (appSpecifications.expire < config.fluxapps.minBlocksAllowance) {
throw new Error(`Minimum expiration of application is ${config.fluxapps.minBlocksAllowance} blocks ~ 1 week`);
}
} else if (appSpecifications.expire < config.fluxapps.newMinBlocksAllowance) {
throw new Error(`Minimum expiration of application is ${config.fluxapps.minBlocksAllowance} blocks ~ 3 hours`);
}
if (appSpecifications.expire > config.fluxapps.maxBlocksAllowance) {
throw new Error(`Maximum expiration of application is ${config.fluxapps.maxBlocksAllowance} blocks ~ 1 year`);
Expand Down Expand Up @@ -7222,9 +7226,6 @@ function specificationFormatter(appSpecification) {
if (Number.isInteger(expire) !== true) {
throw new Error('Invalid instances specified');
}
if (expire < config.fluxapps.minBlocksAllowance) {
throw new Error(`Minimum expiration of application is ${config.fluxapps.minBlocksAllowance} blocks ~ 1 week`);
}
if (expire > config.fluxapps.maxBlocksAllowance) {
throw new Error(`Maximum expiration of application is ${config.fluxapps.maxBlocksAllowance} blocks ~ 1 year`);
}
Expand Down
4 changes: 4 additions & 0 deletions ZelBack/src/services/fluxService.js
Original file line number Diff line number Diff line change
Expand Up @@ -977,6 +977,10 @@ async function getFluxInfo(req, res) {
throw daemonInfoRes.data;
}
info.daemon.info = daemonInfoRes.data;
if (info.daemon.info.blocks >= config.syncthingVersionCheckStart) {
const versionMinOK = fluxNetworkHelper.minVersionSatisfy(info.flux.syncthingVersion.replace(/[^\d.]/g, ''), '1.27.6');
if (!versionMinOK) throw new Error('Syncthing version bellow minimum version allowed 1.27.6, update your machine.');
}
const daemonNodeStatusRes = await daemonServiceFluxnodeRpcs.getFluxNodeStatus();
if (daemonNodeStatusRes.status === 'error') {
throw daemonNodeStatusRes.data;
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "flux",
"version": "5.3.0",
"version": "5.4.0",
"description": "Flux, Your Gateway to a Decentralized World",
"repository": {
"type": "git",
Expand Down
14 changes: 7 additions & 7 deletions tests/unit/fluxNetworkHelper.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ describe('fluxNetworkHelper tests', () => {
const fluxAvailabilitySuccessResponse = {
data: {
status: 'success',
data: '4.20.0',
data: '5.0.0',
},
};
Object.setPrototypeOf(fluxAvailabilitySuccessResponse.data, { // axios on home expects string
Expand All @@ -52,7 +52,7 @@ describe('fluxNetworkHelper tests', () => {
const fluxAvailabilityErrorResponse = {
data: {
status: 'error',
data: '4.20.0',
data: '5.0.0',
},
};
const generateResponse = () => {
Expand Down Expand Up @@ -305,7 +305,7 @@ describe('fluxNetworkHelper tests', () => {
const mockResponse = {
data: {
status: 'success',
data: '4.20.0',
data: '5.0.0',
},
};
Object.setPrototypeOf(mockResponse.data, { // axios on home expects string
Expand Down Expand Up @@ -1009,7 +1009,7 @@ describe('fluxNetworkHelper tests', () => {
});

describe('checkFluxbenchVersionAllowed tests', () => {
// minimumFluxBenchAllowedVersion = '3.9.0';
// minimumFluxBenchAllowedVersion = '4.0.0';
let benchmarkInfoResponseStub;

beforeEach(() => {
Expand All @@ -1030,7 +1030,7 @@ describe('fluxNetworkHelper tests', () => {
});

it('should return true if bench version is equal to minimal and stored in cache', async () => {
fluxNetworkHelper.setStoredFluxBenchAllowed('3.9.0');
fluxNetworkHelper.setStoredFluxBenchAllowed('4.0.0');

const isFluxbenchVersionAllowed = await fluxNetworkHelper.checkFluxbenchVersionAllowed();

Expand Down Expand Up @@ -1064,15 +1064,15 @@ describe('fluxNetworkHelper tests', () => {
const benchmarkInfoResponse = {
status: 'success',
data: {
version: '3.9.0',
version: '4.0.0',
},
};
benchmarkInfoResponseStub.returns(benchmarkInfoResponse);

const isFluxbenchVersionAllowed = await fluxNetworkHelper.checkFluxbenchVersionAllowed();

expect(isFluxbenchVersionAllowed).to.equal(true);
expect(fluxNetworkHelper.getStoredFluxBenchAllowed()).to.equal('3.9.0');
expect(fluxNetworkHelper.getStoredFluxBenchAllowed()).to.equal('4.0.0');
});

it('should return false if the version is lower than minimal and is not set in cache', async () => {
Expand Down
7 changes: 5 additions & 2 deletions tests/unit/globalconfig/default.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,11 @@ module.exports = {
porttestnet: 26125,
rpcporttestnet: 26124,
},
minimumFluxBenchAllowedVersion: '3.9.0',
minimumFluxOSAllowedVersion: '4.5.0',
minimumFluxBenchAllowedVersion: '4.0.0',
minimumFluxOSAllowedVersion: '5.0.0',
fluxTeamZelId: '1NH9BP155Rp3HSf5ef6NpUbE8JcyLRruAM',
deterministicNodesStart: 558000,
syncthingVersionCheckStart: 1630040, // block where we will start looking at a min. syncthing version installed. block expected on 26th of April 2024
fluxapps: {
// in flux main chain per month (blocksLasting)
price: [
Expand Down Expand Up @@ -199,6 +200,8 @@ module.exports = {
},
blocksLasting: 22000, // by default registered app will live for 22000 of blocks 44000 minutes ~= 1 month
minBlocksAllowance: 5000, // app can be registered for a minimum of this blocks ~ 1 week
newMinBlocksAllowance: 100, // app can be registered for a minimum of this blocks ~ 3 hours - to allow users to cancel application subscription
newMinBlocksAllowanceBlock: 1630040, // block where we will start looking at new min blocks allowance. block expected on 26th of April 2024
maxBlocksAllowance: 264000, // app can be registered up for a maximum of this blocks ~ 1 year
blocksAllowanceInterval: 1000, // ap differences can be in 1000s - more than 1 day
removeBlocksAllowanceIntervalBlock: 1625000, // after this block we can start having app updates without extending subscription - block expected in April 19th 2024
Expand Down

0 comments on commit 51ea029

Please sign in to comment.