Skip to content

Commit

Permalink
updated build heap size
Browse files Browse the repository at this point in the history
  • Loading branch information
litecreator committed May 11, 2021
1 parent 17f6541 commit 05eb152
Show file tree
Hide file tree
Showing 10 changed files with 40 additions and 25 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ src/main/resources/META-INF/

# output directory
/output-directory/
/xlt-testnet-rc1-output-directory/
/output_ChargeTest/

/output_manager/
/output_witness/
Expand Down
4 changes: 3 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ buildscript {
plugins {
id "org.sonarqube" version "2.6"
}

tasks.withType(JavaExec) {
jvmArgs = ['-Xms2048m', '-Xmx2048m']
}
group 'org.litetokens'
version '1.0.0'

Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,8 @@ public void throwTest()

String contractName = "test";
byte[] address = Hex.decode(OWNER_ADDRESS);
String ABI = "[{\"constant\":false,\"inputs\":[],\"name\":\"testThrow\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]";
String ABI = "[{\"constant\":false,\"inputs\":[],\"name\":\"testThrow\",\"outputs\":[],"
+ "\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]";
String code = "6080604052348015600f57600080fd5b5060838061001e6000396000f3006080604052600436106"
+ "03e5763ffffffff7c0100000000000000000000000000000000000000000000000000000000600035041663"
+ "50bff6bf81146043575b600080fd5b348015604e57600080fd5b506055603e565b0000a165627a7a7230582"
Expand Down Expand Up @@ -140,8 +141,12 @@ public void requireTest()

String contractName = "test";
byte[] address = Hex.decode(OWNER_ADDRESS);
String ABI = "[{\"constant\":false,\"inputs\":[],\"name\":\"testRequire\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]";
String code = "6080604052348015600f57600080fd5b5060838061001e6000396000f300608060405260043610603e5763ffffffff7c0100000000000000000000000000000000000000000000000000000000600035041663357815c481146043575b600080fd5b348015604e57600080fd5b506055603e565b0000a165627a7a7230582054141931bcc37d4f266815f02d2fb113f5af20825cbce45d3b0f2fe90ac0145d0029";
String ABI = "[{\"constant\":false,\"inputs\":[],\"name\":\"testRequire\",\"outputs\":[],\""
+ "payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]";
String code = "6080604052348015600f57600080fd5b5060838061001e6000396000f3006080604052600436106"
+ "03e5763ffffffff7c0100000000000000000000000000000000000000000000000000000000600035041663"
+ "357815c481146043575b600080fd5b348015604e57600080fd5b506055603e565b0000a165627a7a7230582"
+ "054141931bcc37d4f266815f02d2fb113f5af20825cbce45d3b0f2fe90ac0145d0029";
String libraryAddressPair = null;

LVMTestResult result = LVMTestUtils
Expand Down Expand Up @@ -195,7 +200,10 @@ public void thisFunctionViaMessageCallTest()

String contractName = "test";
byte[] address = Hex.decode(OWNER_ADDRESS);
String ABI = "[{\"constant\":false,\"inputs\":[],\"name\":\"testAssert\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[],\"name\":\"testThisFunctionViaMessageCall\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]";
String ABI = "[{\"constant\":false,\"inputs\":[],\"name\":\"testAssert\",\"outputs\":[],"
+ "\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},"
+ "{\"constant\":false,\"inputs\":[],\"name\":\"testThisFunctionViaMessageCall\","
+ "\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]";
String code = "608060405234801561001057600080fd5b50610121806100206000396000f300608060405260043"
+ "61060485763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504"
+ "16632b813bc08114604d5780635df83fe7146061575b600080fd5b348015605857600080fd5b50605f60735"
Expand Down Expand Up @@ -266,7 +274,8 @@ public void thatFunctionViaMessageCallTest()

String contractName = "test";
byte[] address = Hex.decode(OWNER_ADDRESS);
String ABI = "[{\"constant\":false,\"inputs\":[],\"name\":\"testThatFunctionViaMessageCall\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]";
String ABI = "[{\"constant\":false,\"inputs\":[],\"name\":\"testThatFunctionViaMessageCall\","
+ "\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]";
String code = "608060405234801561001057600080fd5b506101e6806100206000396000f300608060405260043"
+ "6106100405763ffffffff7c0100000000000000000000000000000000000000000000000000000000600035"
+ "0416637dbc1cb88114610045575b600080fd5b34801561005157600080fd5b5061005a61005c565b005b600"
Expand Down
36 changes: 18 additions & 18 deletions src/test/java/org/litetokens/core/db/ManagerTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -230,21 +230,21 @@ public void fork()
byte[] address = ecKey.getAddress();
WitnessCapsule witnessCapsule = new WitnessCapsule(ByteString.copyFrom(address));
dbManager.addWitness(ByteString.copyFrom(address));
dbManager.generateBlock(witnessCapsule, 1533529947843L, privateKey, false);
dbManager.generateBlock(witnessCapsule, 1620400001000L, privateKey, false);

Map<ByteString, String> addressToProvateKeys = addTestWitnessAndAccount();

long num = dbManager.getDynamicPropertiesStore().getLatestBlockHeaderNumber();
BlockCapsule blockCapsule0 =
createTestBlockCapsule(
1533529947843L + 3000,
1620400001000L + 3000,
num + 1,
dbManager.getDynamicPropertiesStore().getLatestBlockHeaderHash().getByteString(),
addressToProvateKeys);

BlockCapsule blockCapsule1 =
createTestBlockCapsule(
1533529947843L + 3000,
1620400001000L + 3000,
num + 1,
dbManager.getDynamicPropertiesStore().getLatestBlockHeaderHash().getByteString(),
addressToProvateKeys);
Expand All @@ -254,7 +254,7 @@ public void fork()

BlockCapsule blockCapsule2 =
createTestBlockCapsule(
1533529947843L + 6000,
1620400001000L + 6000,
num + 2, blockCapsule1.getBlockId().getByteString(), addressToProvateKeys);

dbManager.pushBlock(blockCapsule2);
Expand Down Expand Up @@ -299,21 +299,21 @@ public void doNotSwitch()
byte[] address = ecKey.getAddress();
WitnessCapsule witnessCapsule = new WitnessCapsule(ByteString.copyFrom(address));
dbManager.addWitness(ByteString.copyFrom(address));
dbManager.generateBlock(witnessCapsule, 1533529947843L, privateKey, false);
dbManager.generateBlock(witnessCapsule, 1620400001000L, privateKey, false);

Map<ByteString, String> addressToProvateKeys = addTestWitnessAndAccount();

long num = dbManager.getDynamicPropertiesStore().getLatestBlockHeaderNumber();
BlockCapsule blockCapsule0 =
createTestBlockCapsule(
1533529947843L + 3000,
1620400001000L + 3000,
num + 1,
dbManager.getDynamicPropertiesStore().getLatestBlockHeaderHash().getByteString(),
addressToProvateKeys);

BlockCapsule blockCapsule1 =
createTestBlockCapsule(
1533529947843L + 3001,
1620400001000L + 3001,
num + 1,
dbManager.getDynamicPropertiesStore().getLatestBlockHeaderHash().getByteString(),
addressToProvateKeys);
Expand All @@ -328,7 +328,7 @@ public void doNotSwitch()

BlockCapsule blockCapsule2 =
createTestBlockCapsule(
1533529947843L + 6000,
1620400001000L + 6000,
num + 2, blockCapsule1.getBlockId().getByteString(), addressToProvateKeys);
logger.info("******block2:" + blockCapsule2);
try {
Expand All @@ -348,7 +348,7 @@ public void doNotSwitch()
}

BlockCapsule blockCapsule3 =
createTestBlockCapsule(1533529947843L + 9000,
createTestBlockCapsule(1620400001000L + 9000,
dbManager.getDynamicPropertiesStore().getLatestBlockHeaderNumber() + 1,
dbManager.getDynamicPropertiesStore().getLatestBlockHeaderHash().getByteString(),
addressToProvateKeys);
Expand All @@ -363,7 +363,7 @@ public void doNotSwitch()
.getBlockId());

BlockCapsule blockCapsule4 =
createTestBlockCapsule(1533529947843L + 12000,
createTestBlockCapsule(1620400001000L + 12000,
dbManager.getDynamicPropertiesStore().getLatestBlockHeaderNumber() + 1,
blockCapsule3.getBlockId().getByteString(), addressToProvateKeys);
logger.info("******block4:" + blockCapsule4);
Expand Down Expand Up @@ -396,12 +396,12 @@ public void testLastHeadBlockIsMaintenance()
WitnessCapsule witnessCapsule = new WitnessCapsule(ByteString.copyFrom(address));
dbManager.addWitness(ByteString.copyFrom(address));
BlockCapsule blockCapsule =
dbManager.generateBlock(witnessCapsule, 1533529947843L, privateKey, true);
dbManager.generateBlock(witnessCapsule, 1620400001000L, privateKey, true);

//has processed the first block of the maintenance period before starting the block
dbManager.getWitnessStore().reset();
dbManager.getDynamicPropertiesStore().saveStateFlag(0);
blockCapsule = dbManager.generateBlock(witnessCapsule, 1533529947843L, privateKey, true);
blockCapsule = dbManager.generateBlock(witnessCapsule, 1620400001000L, privateKey, true);
Assert.assertTrue(blockCapsule == null);
}

Expand All @@ -421,21 +421,21 @@ public void switchBack()
byte[] address = ecKey.getAddress();
WitnessCapsule witnessCapsule = new WitnessCapsule(ByteString.copyFrom(address));
dbManager.addWitness(ByteString.copyFrom(address));
dbManager.generateBlock(witnessCapsule, 1533529947843L, privateKey, false);
dbManager.generateBlock(witnessCapsule, 1620400001000L, privateKey, false);

Map<ByteString, String> addressToProvateKeys = addTestWitnessAndAccount();

long num = dbManager.getDynamicPropertiesStore().getLatestBlockHeaderNumber();
BlockCapsule blockCapsule0 =
createTestBlockCapsule(
1533529947843L + 3000,
1620400001000L + 3000,
num + 1,
dbManager.getDynamicPropertiesStore().getLatestBlockHeaderHash().getByteString(),
addressToProvateKeys);

BlockCapsule blockCapsule1 =
createTestBlockCapsule(
1533529947843L + 3000,
1620400001000L + 3000,
num + 1,
dbManager.getDynamicPropertiesStore().getLatestBlockHeaderHash().getByteString(),
addressToProvateKeys);
Expand All @@ -445,7 +445,7 @@ public void switchBack()
try {
BlockCapsule blockCapsule2 =
createTestBlockCapsuleError(
1533529947843L + 6000,
1620400001000L + 6000,
num + 2, blockCapsule1.getBlockId().getByteString(), addressToProvateKeys);

dbManager.pushBlock(blockCapsule2);
Expand All @@ -459,7 +459,7 @@ public void switchBack()

BlockCapsule blockCapsule3 =
createTestBlockCapsule(
1533529947843L + 9000,
1620400001000L + 9000,
dbManager.getDynamicPropertiesStore().getLatestBlockHeaderNumber() + 1,
blockCapsule0.getBlockId().getByteString(), addressToProvateKeys);
dbManager.pushBlock(blockCapsule3);
Expand All @@ -473,7 +473,7 @@ public void switchBack()

BlockCapsule blockCapsule4 =
createTestBlockCapsule(
1533529947843L + 12000,
1620400001000L + 12000,
dbManager.getDynamicPropertiesStore().getLatestBlockHeaderNumber() + 1,
blockCapsule3.getBlockId().getByteString(), addressToProvateKeys);
dbManager.pushBlock(blockCapsule4);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,9 @@ public void testGetBlockChainSummary() {
ReflectUtils.setFieldValue(peer_he, "headBlockTimeWeBothHave", System.currentTimeMillis());
Deque<BlockCapsule.BlockId> retSummary = del
.getBlockChainSummary(peer_he.getHeadBlockWeBothHave(), peer_he.getSyncBlockToFetch());
Assert.assertTrue(retSummary.size() == 4);
// kedia debug: logger.info("Kedia The sum is " + retSummary.size());
// the below changes to 3 when SOLIDIFIED_THRESHOLD changes to 10
Assert.assertTrue(retSummary.size() == 3);
} catch (Exception e) {
System.out.println("exception!");
}
Expand Down

0 comments on commit 05eb152

Please sign in to comment.