Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
27 changes: 15 additions & 12 deletions common/src/main/java/org/tron/common/parameter/CommonParameter.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import org.tron.core.config.args.Overlay;
import org.tron.core.config.args.SeedNode;
import org.tron.core.config.args.Storage;
import org.tron.p2p.P2pConfig;
import org.tron.p2p.dns.update.PublishConfig;

public class CommonParameter {
Expand Down Expand Up @@ -169,6 +170,8 @@ public class CommonParameter {
@Setter
public int minParticipationRate;
@Getter
public P2pConfig p2pConfig;
@Getter
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This modification has nothing to do with this PR, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, there is something wrong when split pr. I have deleted it.

@Setter
public int nodeListenPort;
@Getter
Expand All @@ -177,21 +180,21 @@ public class CommonParameter {
@Getter
@Setter
public String nodeExternalIp;
@Getter
@Setter
public boolean nodeDiscoveryPublicHomeNode;
@Getter
@Setter
public long nodeDiscoveryPingTimeout;
@Getter
@Setter
public long nodeP2pPingInterval;
// @Getter
// @Setter
// public boolean nodeDiscoveryPublicHomeNode;
// @Getter
// @Setter
// public long nodeDiscoveryPingTimeout;
// @Getter
// @Setter
// public long nodeP2pPingInterval;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is it commented out instead of just deleting the code?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could delete it next release version.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not just delete it?

+ 1, git ensures that changes are kept.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok,I will delete it

@Getter
@Setter
public int nodeP2pVersion;
@Getter
@Setter
public String p2pNodeId;
// @Getter
// @Setter
// public String p2pNodeId;
@Getter
@Setter
public boolean nodeEnableIpv6 = false;
Expand Down
4 changes: 2 additions & 2 deletions common/src/main/java/org/tron/core/Constant.java
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,8 @@ public class Constant {
public static final String NODE_MAX_CONNECTIONS_WITH_SAME_IP = "node.maxConnectionsWithSameIp";
public static final String NODE_MIN_PARTICIPATION_RATE = "node.minParticipationRate";
public static final String NODE_LISTEN_PORT = "node.listen.port";
public static final String NODE_DISCOVERY_PUBLIC_HOME_NODE = "node.discovery.public.home.node";
public static final String NODE_DISCOVERY_PING_TIMEOUT = "node.discovery.ping.timeout";
//public static final String NODE_DISCOVERY_PUBLIC_HOME_NODE = "node.discovery.public.home.node";
//public static final String NODE_DISCOVERY_PING_TIMEOUT = "node.discovery.ping.timeout";

public static final String NODE_P2P_PING_INTERVAL = "node.p2p.pingInterval";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not delete NODE_P2P_PING_INTERVAL?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, there is something wrong when split pr. I have deleted it.

public static final String NODE_P2P_VERSION = "node.p2p.version";
Expand Down
27 changes: 14 additions & 13 deletions framework/src/main/java/org/tron/core/config/args/Args.java
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@
import org.tron.core.store.AccountStore;
import org.tron.keystore.Credentials;
import org.tron.keystore.WalletUtils;
import org.tron.p2p.P2pConfig;
import org.tron.p2p.dns.update.DnsType;
import org.tron.p2p.dns.update.PublishConfig;
import org.tron.p2p.utils.NetUtil;
Expand Down Expand Up @@ -140,9 +141,9 @@ public static void clearParam() {
PARAMETER.nodeListenPort = 0;
PARAMETER.nodeDiscoveryBindIp = "";
PARAMETER.nodeExternalIp = "";
PARAMETER.nodeDiscoveryPublicHomeNode = false;
PARAMETER.nodeDiscoveryPingTimeout = 15000;
PARAMETER.nodeP2pPingInterval = 0L;
// PARAMETER.nodeDiscoveryPublicHomeNode = false;
// PARAMETER.nodeDiscoveryPingTimeout = 15000;
// PARAMETER.nodeP2pPingInterval = 0L;
PARAMETER.nodeP2pVersion = 0;
PARAMETER.nodeEnableIpv6 = false;
PARAMETER.dnsTreeUrls = new ArrayList<>();
Expand Down Expand Up @@ -170,7 +171,7 @@ public static void clearParam() {
PARAMETER.forbidTransferToContract = 0;
PARAMETER.tcpNettyWorkThreadNum = 0;
PARAMETER.udpNettyWorkThreadNum = 0;
PARAMETER.p2pNodeId = "";
// PARAMETER.p2pNodeId = "";
PARAMETER.solidityNode = false;
PARAMETER.trustNodeAddr = "";
PARAMETER.walletExtensionApi = false;
Expand Down Expand Up @@ -639,17 +640,17 @@ public static void setParam(final String[] args, final String confFileName) {
bindIp(config);
externalIp(config);

PARAMETER.nodeDiscoveryPublicHomeNode =
config.hasPath(Constant.NODE_DISCOVERY_PUBLIC_HOME_NODE) && config
.getBoolean(Constant.NODE_DISCOVERY_PUBLIC_HOME_NODE);
//PARAMETER.nodeDiscoveryPublicHomeNode =
// config.hasPath(Constant.NODE_DISCOVERY_PUBLIC_HOME_NODE) && config
// .getBoolean(Constant.NODE_DISCOVERY_PUBLIC_HOME_NODE);

PARAMETER.nodeDiscoveryPingTimeout =
config.hasPath(Constant.NODE_DISCOVERY_PING_TIMEOUT)
? config.getLong(Constant.NODE_DISCOVERY_PING_TIMEOUT) : 15000;
//PARAMETER.nodeDiscoveryPingTimeout =
// config.hasPath(Constant.NODE_DISCOVERY_PING_TIMEOUT)
// ? config.getLong(Constant.NODE_DISCOVERY_PING_TIMEOUT) : 15000;

PARAMETER.nodeP2pPingInterval =
config.hasPath(Constant.NODE_P2P_PING_INTERVAL)
? config.getLong(Constant.NODE_P2P_PING_INTERVAL) : 0;
//PARAMETER.nodeP2pPingInterval =
// config.hasPath(Constant.NODE_P2P_PING_INTERVAL)
// ? config.getLong(Constant.NODE_P2P_PING_INTERVAL) : 0;

PARAMETER.nodeP2pVersion =
config.hasPath(Constant.NODE_P2P_VERSION)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,13 @@
import org.tron.core.config.args.Args;



public class ArgsTest {

private static final String dbPath = "output_arg_test";

@Before
public void init() {
Args.setParam(new String[]{"--output-directory", dbPath, "--p2p-disable", "true",
Args.setParam(new String[] {"--output-directory", dbPath, "--p2p-disable", "true",
"--debug"}, Constant.TEST_CONF);
}

Expand All @@ -32,7 +31,7 @@ public void destroy() {
public void testConfig() {
Assert.assertEquals(Args.getInstance().getMaxTransactionPendingSize(), 2000);
Assert.assertEquals(Args.getInstance().getPendingTransactionTimeout(), 60_000);
Assert.assertEquals(Args.getInstance().getNodeDiscoveryPingTimeout(), 15_000);
//Assert.assertEquals(Args.getInstance().getNodeDiscoveryPingTimeout(), 15_000);
Assert.assertEquals(Args.getInstance().getMaxFastForwardNum(), 3);
Assert.assertEquals(Args.getInstance().getBlockCacheTimeout(), 60);
Assert.assertEquals(Args.getInstance().isNodeDetectEnable(), false);
Expand Down