Skip to content
This repository has been archived by the owner on Aug 23, 2020. It is now read-only.

Commit

Permalink
Merge pull request #264 from alfredch/public-testnet-1.3.1
Browse files Browse the repository at this point in the history
Public testnet 1.3.1 changes for mwm9 and new snapshot
  • Loading branch information
alfredch authored Aug 10, 2017
2 parents 8b179d2 + 496e195 commit 5fb4c11
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 22,260 deletions.
2 changes: 1 addition & 1 deletion src/main/java/com/iota/iri/Milestone.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public class Milestone {
public Hash latestMilestone = Hash.NULL_HASH;
public Hash latestSolidSubtangleMilestone = latestMilestone;

public static final int MILESTONE_START_INDEX = 151000;
public static final int MILESTONE_START_INDEX = 0;
private static final int NUMBER_OF_KEYS_IN_A_MILESTONE = 20;

public int latestMilestoneIndex = MILESTONE_START_INDEX;
Expand Down
7 changes: 6 additions & 1 deletion src/main/java/com/iota/iri/Snapshot.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import com.iota.iri.hash.ISS;
import com.iota.iri.hash.SpongeFactory;
import com.iota.iri.model.Hash;
import com.iota.iri.conf.Configuration;
import com.iota.iri.controllers.TransactionViewModel;
import com.iota.iri.utils.Converter;
import org.apache.commons.lang3.ArrayUtils;
Expand Down Expand Up @@ -46,7 +47,9 @@ public class Snapshot {
initialState.put(new Hash(key), Long.valueOf(value));
}
}
{ // Check snapshot signature
/*
{
// Check snapshot signature
trits = new int[Curl.HASH_LENGTH];
curl.squeeze(trits, 0, Curl.HASH_LENGTH);
int[] digests = new int[0];
Expand All @@ -63,6 +66,8 @@ public class Snapshot {
throw new RuntimeException("Snapshot signature failed.");
}
}
*/

} catch (IOException e) {
System.out.println("Failed to load snapshot.");
System.exit(-1);
Expand Down
8 changes: 4 additions & 4 deletions src/main/java/com/iota/iri/TransactionValidator.java
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@ public void init(boolean testnet,int MAINNET_MWM, int TESTNET_MWM) {
} else {
MIN_WEIGHT_MAGNITUDE = MAINNET_MWM;
}
//lowest allowed MWM encoded in 46 bytes.
if (MIN_WEIGHT_MAGNITUDE<13){
MIN_WEIGHT_MAGNITUDE = 13;
//lowest allowed MWM encoded in 49 bytes.
if (MIN_WEIGHT_MAGNITUDE < 9){
MIN_WEIGHT_MAGNITUDE = 9;
}

newSolidThread = new Thread(spawnSolidTransactionsPropagation(), "Solid TX cascader");
Expand All @@ -70,7 +70,7 @@ public int getMinWeightMagnitude() {

private static void runValidation(TransactionViewModel transactionViewModel, final int minWeightMagnitude) {
transactionViewModel.setMetadata();
if(transactionViewModel.getTimestamp() < 1502226000 && !transactionViewModel.getHash().equals(Hash.NULL_HASH)) {
if(transactionViewModel.getTimestamp() < 1502366400 && !transactionViewModel.getHash().equals(Hash.NULL_HASH)) {
throw new RuntimeException("Invalid transaction timestamp.");
}

Expand Down
10 changes: 5 additions & 5 deletions src/main/java/com/iota/iri/conf/Configuration.java
Original file line number Diff line number Diff line change
Expand Up @@ -77,16 +77,16 @@ public enum DefaultConfSettings {
conf.put(DefaultConfSettings.REMOTE_AUTH.name(), "");
conf.put(DefaultConfSettings.NEIGHBORS.name(), "");
conf.put(DefaultConfSettings.IXI_DIR.name(), "ixi");
conf.put(DefaultConfSettings.DB_PATH.name(), "mainnetdb");
conf.put(DefaultConfSettings.DB_LOG_PATH.name(), "mainnet.log");
conf.put(DefaultConfSettings.DB_PATH.name(), "testnetdb");
conf.put(DefaultConfSettings.DB_LOG_PATH.name(), "testnetdb.log");
conf.put(DefaultConfSettings.DB_CACHE_SIZE.name(), "100000"); //KB
conf.put(DefaultConfSettings.CONFIG.name(), "iota.ini");
conf.put(DefaultConfSettings.P_REMOVE_REQUEST.name(), "0.01");
conf.put(DefaultConfSettings.P_DROP_TRANSACTION.name(), "0.0");
conf.put(DefaultConfSettings.P_SELECT_MILESTONE_CHILD.name(), "0.7");
conf.put(DefaultConfSettings.P_SEND_MILESTONE.name(), "0.02");
conf.put(DefaultConfSettings.P_REPLY_RANDOM_TIP.name(), "0.66");
conf.put(DefaultConfSettings.P_PROPAGATE_REQUEST.name(), "0.01");
conf.put(DefaultConfSettings.P_REPLY_RANDOM_TIP.name(), "1.00");
conf.put(DefaultConfSettings.P_PROPAGATE_REQUEST.name(), "0.02");
conf.put(DefaultConfSettings.MAIN_DB.name(), "rocksdb");
conf.put(DefaultConfSettings.EXPORT.name(), "false");
conf.put(DefaultConfSettings.SEND_LIMIT.name(), "-1.0");
Expand All @@ -95,7 +95,7 @@ public enum DefaultConfSettings {
conf.put(DefaultConfSettings.REVALIDATE.name(), "false");
conf.put(DefaultConfSettings.RESCAN_DB.name(), "false");
conf.put(DefaultConfSettings.MAINNET_MWM.name(), "15");
conf.put(DefaultConfSettings.TESTNET_MWM.name(), "13");
conf.put(DefaultConfSettings.TESTNET_MWM.name(), "9");

// Pick a number based on best performance
conf.put(DefaultConfSettings.MIN_RANDOM_WALKS.name(), "5");
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/com/iota/iri/network/Node.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,12 @@ public class Node {
private static final Logger log = LoggerFactory.getLogger(Node.class);


public static final int TRANSACTION_PACKET_SIZE = 1650;
public static final int TRANSACTION_PACKET_SIZE = 1653;
private static final int QUEUE_SIZE = 1000;
private static final int RECV_QUEUE_SIZE = 1000;
private static final int REPLY_QUEUE_SIZE = 1000;
private static final int PAUSE_BETWEEN_TRANSACTIONS = 1;
public static final int REQUEST_HASH_SIZE = 46;
public static final int REQUEST_HASH_SIZE = 49;
private static double P_SELECT_MILESTONE;

private final AtomicBoolean shuttingDown = new AtomicBoolean(false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public class TransactionRequester {
private final Set<Hash> milestoneTransactionsToRequest = new LinkedHashSet<>();
private final Set<Hash> transactionsToRequest = new LinkedHashSet<>();
private static volatile long lastTime = System.currentTimeMillis();
public static final int REQUEST_HASH_SIZE = 46;
public static final int REQUEST_HASH_SIZE = 49;
private static final byte[] NULL_REQUEST_HASH_BYTES = new byte[REQUEST_HASH_SIZE];

private static double P_REMOVE_REQUEST;
Expand Down
Loading

0 comments on commit 5fb4c11

Please sign in to comment.