Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Testnet Release 6.5.1+hotfix.2 #3278

Merged
merged 12 commits into from
Sep 9, 2024
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
2 changes: 1 addition & 1 deletion config/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -637,7 +637,7 @@
"enabled": false,
"package": "./blockchain/implementation/ot-parachain/ot-parachain-service.js",
"config": {
"hubContractAddress": "0x833048F6e6BEa78E0AAdedeCd2Dc2231dda443FB",
"hubContractAddress": "0x0425d8717a9c63345a26C7885CF8c0fEAbcE7bC9",
"rpcEndpoints": [
"https://lofar-tm-rpc.origin-trail.network",
"https://lofar.origintrail.network"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,38 +1,69 @@
{
"modules":{
"network": {
"implementation": {
"libp2p-service": {
"config": {
"nat": {
"enabled": true,
"externalIp": "<node_static_ip_address>"
}
}
}
}
},
"blockchain":{
"implementation":{
"otp:2043":{
"enabled":true,
"config":{
"sharesTokenSymbol":"<shares_token_symbol>",
"sharesTokenName":"<shares_token_name>",
"evmManagementWalletPublicKey":"<emv_management_key_public_key>",
"sharesTokenName":"<node_name>",
"sharesTokenSymbol":"<node_symbol>",
"operatorFee":"<operator_fee>",
"evmManagementWalletPublicKey":"<management_wallet_public_key>",
"operationalWallets":[
{
"evmAddress":"<evm_operational_key_public_key>",
"privateKey":"<evm_operational_key_private_key>"
"evmAddress":"<operational_wallet_public_key>",
"privateKey":"<operational_wallet_private_key>"
}
]
}
},
"gnosis:100":{
"enabled":true,
"config":{
"operatorFee": <node_operator_fee>,
"sharesTokenSymbol":"<shares_token_symbol>",
"sharesTokenName":"<shares_token_name>",
"sharesTokenName":"<node_name>",
"sharesTokenSymbol":"<node_symbol>",
"operatorFee":"<operator_fee>",
"rpcEndpoints":[
"<gnosis_rpc_endpoint>"
],
"evmManagementWalletPublicKey":"<emv_management_key_public_key>",
"evmManagementWalletPublicKey":"<management_wallet_public_key>",
"operationalWallets":[
{
"evmAddress":"<evm_operational_key_public_key>",
"privateKey":"<evm_operational_key_private_key>"
"evmAddress":"<operational_wallet_public_key>",
"privateKey":"<operational_wallet_private_key>"
}
]
}
},
"base:8453":{
"enabled":true,
"config":{
"evmManagementWalletPublicKey":"<management_wallet_public_key>",
"operationalWallets":[
{
"evmAddress":"<operational_wallet_public_key>",
"privateKey":"<operational_wallet_private_key>"
}
],
"sharesTokenName":"<node_name>",
"sharesTokenSymbol":"<node_symbol>",
"operatorFee":"<operator_fee>",
"rpcEndpoints":[
"<base_rpc_endpoint>"
]
}
}
}
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,38 +1,69 @@
{
"modules":{
"network": {
"implementation": {
"libp2p-service": {
"config": {
"nat": {
"enabled": true,
"externalIp": "<node_static_ip_address>"
}
}
}
}
},
"blockchain":{
"implementation":{
"otp:20430":{
"enabled":true,
"config":{
"sharesTokenSymbol":"<shares_token_symbol>",
"sharesTokenName":"<shares_token_name>",
"evmManagementWalletPublicKey":"<emv_management_key_public_key>",
"sharesTokenName":"<node_name>",
"sharesTokenSymbol":"<node_symbol>",
"operatorFee":"<operator_fee>",
"evmManagementWalletPublicKey":"<management_wallet_public_key>",
"operationalWallets":[
{
"evmAddress":"<evm_operational_key_public_key>",
"privateKey":"<evm_operational_key_private_key>"
"evmAddress":"<operational_wallet_public_key>",
"privateKey":"<operational_wallet_private_key>"
}
]
}
},
"gnosis:10200":{
"enabled":true,
"config":{
"operatorFee": <node_operator_fee>,
"sharesTokenSymbol":"<shares_token_symbol>",
"sharesTokenName":"<shares_token_name>",
"sharesTokenName":"<node_name>",
"sharesTokenSymbol":"<node_symbol>",
"operatorFee":"<operator_fee>",
"rpcEndpoints":[
"<gnosis_rpc_endpoint>"
],
"evmManagementWalletPublicKey":"<emv_management_key_public_key>",
"evmManagementWalletPublicKey":"<management_wallet_public_key>",
"operationalWallets":[
{
"evmAddress":"<evm_operational_key_public_key>",
"privateKey":"<evm_operational_key_private_key>"
"evmAddress":"<operational_wallet_public_key>",
"privateKey":"<operational_wallet_private_key>"
}
]
}
},
"base:84532":{
"enabled":true,
"config":{
"evmManagementWalletPublicKey":"<management_wallet_public_key>",
"operationalWallets":[
{
"evmAddress":"<operational_wallet_public_key>",
"privateKey":"<operational_wallet_private_key>"
}
],
"sharesTokenName":"<node_name>",
"sharesTokenSymbol":"<node_symbol>",
"operatorFee":"<operator_fee>",
"rpcEndpoints":[
"<base_rpc_endpoint>"
]
}
}
}
},
Expand Down
6 changes: 6 additions & 0 deletions ot-node.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,12 @@ class OTNode {
this.config,
);

await MigrationExecutor.executeServiceAgreementPruningMigration(
this.container,
this.logger,
this.config,
);

await this.initializeRouters();
await this.startNetworkModule();
this.startTelemetryModule();
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "origintrail_node",
"version": "6.5.1",
"version": "6.5.1+hotfix.2",
"description": "OTNode V6",
"main": "index.js",
"type": "module",
Expand Down
7 changes: 5 additions & 2 deletions src/constants/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -231,8 +231,11 @@ export const COMMAND_TX_GAS_INCREASE_FACTORS = {
};

export const CONTRACT_FUNCTION_GAS_LIMIT_INCREASE_FACTORS = {
'submitUpdateCommit((address,uint256,bytes,uint8,uint16,uint72,uint72,uint72))': 1.2,
'submitUpdateCommit((address,uint256,bytes,uint8,uint16))': 1.2,
sendProof: 2,
'submitCommit((address,uint256,bytes,uint8,uint16))': 2,
'submitCommit((address,uint256,bytes,uint8,uint16,uint72,uint72,uint72))': 2,
'submitUpdateCommit((address,uint256,bytes,uint8,uint16,uint72,uint72,uint72))': 2,
'submitUpdateCommit((address,uint256,bytes,uint8,uint16))': 2,
};

export const GNOSIS_DEFAULT_GAS_PRICE = {
Expand Down
34 changes: 34 additions & 0 deletions src/migration/devnet-neuro-pruning-migration.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import BaseMigration from './base-migration.js';
import { NODE_ENVIRONMENTS } from '../constants/constants.js';

class DevnetNeuroPruningMigration extends BaseMigration {
constructor(migrationName, logger, config, repositoryModuleManager) {
super(migrationName, logger, config);
this.repositoryModuleManager = repositoryModuleManager;
}

async executeMigration() {
if (process.env.NODE_ENV === NODE_ENVIRONMENTS.DEVNET) {
this.logger.info('Pruning Neuro devenet tables');
// commands are not here as parsing JSON in SQL would take too much time
const tables = [
'blockchain',
'blockchain_event',
'event',
'missed_paranet_asset',
'paranet',
'service_agreement',
'shard',
];
for (const table of tables) {
const query = `
DELETE FROM ${table}
WHERE blockchain_id = 'otp:2160'`;
// eslint-disable-next-line no-await-in-loop
await this.repositoryModuleManager.query(query);
}
}
}
}

export default DevnetNeuroPruningMigration;
27 changes: 27 additions & 0 deletions src/migration/migration-executor.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import MultipleOpWalletsUserConfigurationMigration from './multiple-op-wallets-u
import GetOldServiceAgreementsMigration from './get-old-service-agreements-migration.js';
import ServiceAgreementPruningMigration from './service-agreement-pruning-migration.js';
import RemoveDuplicateServiceAgreementMigration from './remove-duplicate-service-agreement-migration.js';
import DevnetNeuroPruningMigration from './devnet-neuro-pruning-migration.js';

class MigrationExecutor {
static async executePullShardingTableMigration(container, logger, config) {
Expand Down Expand Up @@ -502,6 +503,32 @@ class MigrationExecutor {
}
}

static async executeDevnetNeuroPruningMigration(container, logger, config) {
if (
process.env.NODE_ENV === NODE_ENVIRONMENTS.DEVELOPMENT ||
process.env.NODE_ENV === NODE_ENVIRONMENTS.TEST
)
return;

const repositoryModuleManager = container.resolve('repositoryModuleManager');

const migration = new DevnetNeuroPruningMigration(
'devnetNeuroPruningMigration',
logger,
config,
repositoryModuleManager,
);
if (!(await migration.migrationAlreadyExecuted())) {
try {
await migration.migrate();
} catch (error) {
logger.error(
`Unable to execute devnet neuro pruning migration. Error: ${error.message}`,
);
}
}
}

static exitNode(code = 0) {
process.exit(code);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class OtParachainService extends Web3Service {
this.logger = logger;
this.rpcNumber = 0;
await this.initializeParachainProvider();
await this.checkEvmWallets();
// await this.checkEvmWallets();
await this.parachainProvider.disconnect();
await super.initialize(config, logger);
}
Expand Down
Loading