diff --git a/rskj-core/src/main/java/org/ethereum/db/MutableRepository.java b/rskj-core/src/main/java/org/ethereum/db/MutableRepository.java index 0138b990d9..f92bf4a9ee 100644 --- a/rskj-core/src/main/java/org/ethereum/db/MutableRepository.java +++ b/rskj-core/src/main/java/org/ethereum/db/MutableRepository.java @@ -61,15 +61,19 @@ public class MutableRepository implements Repository { private final IReadWrittenKeysTracker tracker; public MutableRepository(TrieStore trieStore, Trie trie) { - this(new MutableTrieImpl(trieStore, trie), new MutableTrieImpl(new TrieStoreImpl(new HashMapDB()), new Trie())); + this(new MutableTrieImpl(trieStore, trie), aInMemoryMutableTrie()); } public MutableRepository(MutableTrie mutableTrie) { - this(mutableTrie, new MutableTrieImpl(new TrieStoreImpl(new HashMapDB()), new Trie())); + this(mutableTrie, aInMemoryMutableTrie()); } public MutableRepository(MutableTrie mutableTrie, IReadWrittenKeysTracker tracker) { - this(mutableTrie, new MutableTrieImpl(new TrieStoreImpl(new HashMapDB()), new Trie()), tracker); + this(mutableTrie, aInMemoryMutableTrie(), tracker); + } + + private static MutableTrieImpl aInMemoryMutableTrie() { + return new MutableTrieImpl(new TrieStoreImpl(new HashMapDB()), new Trie()); } public MutableRepository(MutableTrie mutableTrie, MutableTrie transientTrie) { @@ -452,7 +456,7 @@ public void addTransientStorageBytes(RskAddress addr, DataWord key, byte[] value @Override public void clearTransientStorage() { - this.transientTrie = new MutableTrieImpl(new TrieStoreImpl(new HashMapDB()), new Trie()); + this.transientTrie = aInMemoryMutableTrie(); } @Nullable diff --git a/rskj-core/src/test/java/co/rsk/vm/opcode/TransientStorageDslTest.java b/rskj-core/src/test/java/co/rsk/vm/opcode/TransientStorageDslTest.java index cca45ec1c3..9bff2017b6 100644 --- a/rskj-core/src/test/java/co/rsk/vm/opcode/TransientStorageDslTest.java +++ b/rskj-core/src/test/java/co/rsk/vm/opcode/TransientStorageDslTest.java @@ -175,10 +175,10 @@ void testInConstructorAndCodeCreateContext() throws FileNotFoundException, DslPr processor.processCommands(parser); String txTestTransientStorageCreateContextsContract = "txTestTransientStorageCreateContextsContract"; - assertTransactionReceiptWithStatus(world, txTestTransientStorageCreateContextsContract, "b01", true); + assertTransactionReceiptWithStatus(world, txTestTransientStorageCreateContextsContract, "b01", true, 2); String txInConstructorAndCode = "txInConstructorAndCode"; - TransactionReceipt txReceipt = assertTransactionReceiptWithStatus(world, txInConstructorAndCode, "b02", true); + TransactionReceipt txReceipt = assertTransactionReceiptWithStatus(world, txInConstructorAndCode, "b01", true, 2); Assertions.assertEquals(6, TransactionReceiptUtil.getEventCount(txReceipt, "OK", null)); } @@ -190,10 +190,10 @@ void testAccrossConstructorAndCodeV0CreateContext() throws FileNotFoundException processor.processCommands(parser); String txTestTransientStorageCreateContextsContract = "txTestTransientStorageCreateContextsContract"; - assertTransactionReceiptWithStatus(world, txTestTransientStorageCreateContextsContract, "b01", true); + assertTransactionReceiptWithStatus(world, txTestTransientStorageCreateContextsContract, "b01", true, 2); String txAcrossConstructorAndCodeV0 = "txAcrossConstructorAndCodeV0"; - TransactionReceipt txReceipt = assertTransactionReceiptWithStatus(world, txAcrossConstructorAndCodeV0, "b02", true); + TransactionReceipt txReceipt = assertTransactionReceiptWithStatus(world, txAcrossConstructorAndCodeV0, "b01", true, 2); Assertions.assertEquals(6, TransactionReceiptUtil.getEventCount(txReceipt, "OK", null)); } @@ -238,11 +238,11 @@ void testDynamicExecutionContextSimpleScenario() throws FileNotFoundException, D assertTransactionReceiptWithStatus(world, txCallAndDelegateCallSimpleTest, "b01", true); String txExecuteCallCode = "txExecuteCallCode"; - TransactionReceipt txReceipt = assertTransactionReceiptWithStatus(world, txExecuteCallCode, "b02", true); + TransactionReceipt txReceipt = assertTransactionReceiptWithStatus(world, txExecuteCallCode, "b02", true,2); Assertions.assertEquals(5, TransactionReceiptUtil.getEventCount(txReceipt, "OK", null)); String txExecuteDelegateCall = "txExecuteDelegateCall"; - txReceipt = assertTransactionReceiptWithStatus(world, txExecuteDelegateCall, "b03", true); + txReceipt = assertTransactionReceiptWithStatus(world, txExecuteDelegateCall, "b02", true, 2); Assertions.assertEquals(5, TransactionReceiptUtil.getEventCount(txReceipt, "OK", null)); } @@ -257,15 +257,15 @@ void testDynamicExecutionContextWithRevert() throws FileNotFoundException, DslPr assertTransactionReceiptWithStatus(world, txDynamicExecutionContextWithRevertTest, "b01", true); String txExecuteCallCode = "txExecuteCallCode"; - TransactionReceipt txReceipt = assertTransactionReceiptWithStatus(world, txExecuteCallCode, "b02", true); + TransactionReceipt txReceipt = assertTransactionReceiptWithStatus(world, txExecuteCallCode, "b02", true, 3); Assertions.assertEquals(3, TransactionReceiptUtil.getEventCount(txReceipt, "OK", null)); String txExecuteDelegateCall = "txExecuteDelegateCall"; - txReceipt = assertTransactionReceiptWithStatus(world, txExecuteDelegateCall, "b03", true); + txReceipt = assertTransactionReceiptWithStatus(world, txExecuteDelegateCall, "b02", true, 3); Assertions.assertEquals(3, TransactionReceiptUtil.getEventCount(txReceipt, "OK", null)); String txExecuteCall = "txExecuteCall"; - txReceipt = assertTransactionReceiptWithStatus(world, txExecuteCall, "b04", true); + txReceipt = assertTransactionReceiptWithStatus(world, txExecuteCall, "b02", true, 3); Assertions.assertEquals(3, TransactionReceiptUtil.getEventCount(txReceipt, "OK", null)); } @@ -280,15 +280,15 @@ void testDynamicExecutionContextWithInvalid() throws FileNotFoundException, DslP assertTransactionReceiptWithStatus(world, txDynamicExecutionContextWithInvalidTest, "b01", true); String txExecuteCallCode = "txExecuteCallCode"; - TransactionReceipt txReceipt = assertTransactionReceiptWithStatus(world, txExecuteCallCode, "b02", true); + TransactionReceipt txReceipt = assertTransactionReceiptWithStatus(world, txExecuteCallCode, "b02", true, 3); Assertions.assertEquals(3, TransactionReceiptUtil.getEventCount(txReceipt, "OK", null)); String txExecuteDelegateCall = "txExecuteDelegateCall"; - txReceipt = assertTransactionReceiptWithStatus(world, txExecuteDelegateCall, "b03", true); + txReceipt = assertTransactionReceiptWithStatus(world, txExecuteDelegateCall, "b02", true, 3); Assertions.assertEquals(3, TransactionReceiptUtil.getEventCount(txReceipt, "OK", null)); String txExecuteCall = "txExecuteCall"; - txReceipt = assertTransactionReceiptWithStatus(world, txExecuteCall, "b04", true); + txReceipt = assertTransactionReceiptWithStatus(world, txExecuteCall, "b02", true, 3); Assertions.assertEquals(3, TransactionReceiptUtil.getEventCount(txReceipt, "OK", null)); } @@ -303,15 +303,15 @@ void testDynamicExecutionContextWithStackOverflow() throws FileNotFoundException assertTransactionReceiptWithStatus(world, txDynamicExecutionContextWithStackOverflowTest, "b01", true); String txExecuteCallCode = "txExecuteCallCode"; - TransactionReceipt txReceipt = assertTransactionReceiptWithStatus(world, txExecuteCallCode, "b02", true); + TransactionReceipt txReceipt = assertTransactionReceiptWithStatus(world, txExecuteCallCode, "b02", true,3); Assertions.assertEquals(3, TransactionReceiptUtil.getEventCount(txReceipt, "OK", null)); String txExecuteDelegateCall = "txExecuteDelegateCall"; - txReceipt = assertTransactionReceiptWithStatus(world, txExecuteDelegateCall, "b03", true); + txReceipt = assertTransactionReceiptWithStatus(world, txExecuteDelegateCall, "b02", true, 3); Assertions.assertEquals(3, TransactionReceiptUtil.getEventCount(txReceipt, "OK", null)); String txExecuteCall = "txExecuteCall"; - txReceipt = assertTransactionReceiptWithStatus(world, txExecuteCall, "b04", true); + txReceipt = assertTransactionReceiptWithStatus(world, txExecuteCall, "b02", true, 3); Assertions.assertEquals(3, TransactionReceiptUtil.getEventCount(txReceipt, "OK", null)); } @@ -353,14 +353,14 @@ void testDynamicReentrancyContextsTstoreBeforeRevertOrInvalidHasNoEffect() throw processor.processCommands(parser); String txTstorageDynamicReentrancyContextContract = "txTstorageDynamicReentrancyContextContract"; - assertTransactionReceiptWithStatus(world, txTstorageDynamicReentrancyContextContract, "b01", true); + assertTransactionReceiptWithStatus(world, txTstorageDynamicReentrancyContextContract, "b01", true, 3); String txTestReentrantContextRevert = "txTestReentrantContextRevert"; - TransactionReceipt txReceipt = assertTransactionReceiptWithStatus(world, txTestReentrantContextRevert, "b02", true); + TransactionReceipt txReceipt = assertTransactionReceiptWithStatus(world, txTestReentrantContextRevert, "b01", true, 3); Assertions.assertEquals(3, TransactionReceiptUtil.getEventCount(txReceipt, "OK", null)); String txTestReentrantContextInvalid = "txTestReentrantContextInvalid"; - assertTransactionReceiptWithStatus(world, txTestReentrantContextInvalid, "b03", false); + assertTransactionReceiptWithStatus(world, txTestReentrantContextInvalid, "b01", false, 3); } @Test @@ -414,13 +414,13 @@ void testReentrancyContextsTstoreAfterReentrantCall() throws FileNotFoundExcepti processor.processCommands(parser); String txTstorageReentrancyContextTestContract = "txTstorageReentrancyContextTestContract"; - assertTransactionReceiptWithStatus(world, txTstorageReentrancyContextTestContract, "b01", true); + assertTransactionReceiptWithStatus(world, txTstorageReentrancyContextTestContract, "b01", true, 3); String txTstoreInReentrantCall = "txTstoreInReentrantCall"; - assertTransactionReceiptWithStatus(world, txTstoreInReentrantCall, "b02", true); + assertTransactionReceiptWithStatus(world, txTstoreInReentrantCall, "b01", true, 3); String txCheckValuesStoredInTstorage = "txCheckValuesStoredInTstorage"; - TransactionReceipt txReceipt = assertTransactionReceiptWithStatus(world, txCheckValuesStoredInTstorage, "b03", true); + TransactionReceipt txReceipt = assertTransactionReceiptWithStatus(world, txCheckValuesStoredInTstorage, "b01", true, 3); Assertions.assertEquals(3, TransactionReceiptUtil.getEventCount(txReceipt, "OK", null)); } @@ -580,38 +580,28 @@ void testTloadTstoreCheckingBetweenTransactions() throws FileNotFoundException, assertTransactionReceiptWithStatus(world, txTloadTstoreCheckingBetweenTransactionsContract, "b01", true); String txTstoreAndTloadSomeValue = "txTstoreAndTloadSomeValue"; - Transaction txCreation = world.getTransactionByName(txTstoreAndTloadSomeValue); - assertNotNull(txCreation); - - Block block = world.getBlockByName("b02"); - assertEquals(2, block.getTransactionsList().size()); - - TransactionReceipt txReceipt = world.getTransactionReceiptByName(txTstoreAndTloadSomeValue); - assertNotNull(txReceipt); - byte[] status = txReceipt.getStatus(); - assertNotNull(status); - assertTrue(txReceipt.isSuccessful()); + TransactionReceipt txReceipt = assertTransactionReceiptWithStatus(world, txTstoreAndTloadSomeValue, "b02", true, 2); Assertions.assertEquals(1, TransactionReceiptUtil.getEventCount(txReceipt, "ValueStored", new String[]{"uint256","uint256"})); Assertions.assertEquals(1, TransactionReceiptUtil.getEventCount(txReceipt, "ValueLoaded", new String[]{"uint256","uint256"})); String txTloadSomeValueAndCheckWithExpected = "txTloadSomeValueAndCheckWithExpected"; - TransactionReceipt txReceipt2 = world.getTransactionReceiptByName(txTloadSomeValueAndCheckWithExpected); - assertNotNull(txReceipt2); - status = txReceipt2.getStatus(); - assertNotNull(status); - assertTrue(txReceipt2.isSuccessful()); + TransactionReceipt txReceipt2 = assertTransactionReceiptWithStatus(world, txTloadSomeValueAndCheckWithExpected, "b02", true, 2); Assertions.assertEquals(1, TransactionReceiptUtil.getEventCount(txReceipt2, "ValueLoaded", new String[]{"uint256","uint256"})); Assertions.assertEquals(1, TransactionReceiptUtil.getEventCount(txReceipt2, "OK", null)); } private static TransactionReceipt assertTransactionReceiptWithStatus(World world, String txName, String blockName, boolean withSuccess) { + return assertTransactionReceiptWithStatus(world, txName, blockName, withSuccess, 1); + } + + private static TransactionReceipt assertTransactionReceiptWithStatus(World world, String txName, String blockName, boolean withSuccess, int numberOfTransactionsInBlock) { Transaction txCreation = world.getTransactionByName(txName); assertNotNull(txCreation); Block block = world.getBlockByName(blockName); - assertEquals(1, block.getTransactionsList().size()); + assertEquals(numberOfTransactionsInBlock, block.getTransactionsList().size()); TransactionReceipt txReceipt = world.getTransactionReceiptByName(txName); assertNotNull(txReceipt); diff --git a/rskj-core/src/test/resources/dsl/transient_storage_rskip446/accross_constructor_and_deploy_code_v0_create_context.txt b/rskj-core/src/test/resources/dsl/transient_storage_rskip446/accross_constructor_and_deploy_code_v0_create_context.txt index a44ede8746..d7be1e8d15 100644 --- a/rskj-core/src/test/resources/dsl/transient_storage_rskip446/accross_constructor_and_deploy_code_v0_create_context.txt +++ b/rskj-core/src/test/resources/dsl/transient_storage_rskip446/accross_constructor_and_deploy_code_v0_create_context.txt @@ -105,19 +105,6 @@ transaction_build txTestTransientStorageCreateContextsContract gas 1000000 build -# Create block to hold txTestTransientStorageCreateContextsContract transaction -block_build b01 - parent g00 - transactions txTestTransientStorageCreateContextsContract - gasLimit 1200000 - build - -# Connect block -block_connect b01 - -# Check b01 is best block -assert_best b01 - # Create transaction to execute txInConstructorAndCode transaction transaction_build txAcrossConstructorAndCodeV0 sender acc1 @@ -129,14 +116,14 @@ transaction_build txAcrossConstructorAndCodeV0 build # Create block to hold txAcrossConstructorAndCodeV0 transaction -block_build b02 - parent b01 - transactions txAcrossConstructorAndCodeV0 +block_build b01 + parent g00 + transactions txTestTransientStorageCreateContextsContract txAcrossConstructorAndCodeV0 gasLimit 3000000 build # Connect block -block_connect b02 +block_connect b01 -# Check b02 is best block -assert_best b02 \ No newline at end of file +# Check b01 is best block +assert_best b01 \ No newline at end of file diff --git a/rskj-core/src/test/resources/dsl/transient_storage_rskip446/dynamic_execution_context_simple.txt b/rskj-core/src/test/resources/dsl/transient_storage_rskip446/dynamic_execution_context_simple.txt index 36eac43363..cdc4bf846a 100644 --- a/rskj-core/src/test/resources/dsl/transient_storage_rskip446/dynamic_execution_context_simple.txt +++ b/rskj-core/src/test/resources/dsl/transient_storage_rskip446/dynamic_execution_context_simple.txt @@ -107,22 +107,9 @@ transaction_build txExecuteCallCode contract txCallAndDelegateCallSimpleTest value 0 data a61face90000000000000000000000000000000000000000000000000000000000000001 - gas 1000000 - build - -# Create block to hold txExecuteCallCode transaction -block_build b02 - parent b01 - transactions txExecuteCallCode - gasLimit 2000000 + gas 300000 build -# Connect block -block_connect b02 - -# Check b02 is best block -assert_best b02 - # Create transaction to execute txExecuteDelegateCall transaction transaction_build txExecuteDelegateCall sender acc1 @@ -130,18 +117,18 @@ transaction_build txExecuteDelegateCall contract txCallAndDelegateCallSimpleTest value 0 data a61face90000000000000000000000000000000000000000000000000000000000000000 - gas 1000000 + gas 300000 build -# Create block to hold txExecuteDelegateCall transaction -block_build b03 - parent b02 - transactions txExecuteDelegateCall - gasLimit 2000000 +# Create block to hold transactions +block_build b02 + parent b01 + transactions txExecuteCallCode txExecuteDelegateCall + gasLimit 1500000 build # Connect block -block_connect b03 +block_connect b02 -# Check b03 is best block -assert_best b03 \ No newline at end of file +# Check b02 is best block +assert_best b02 \ No newline at end of file diff --git a/rskj-core/src/test/resources/dsl/transient_storage_rskip446/dynamic_execution_context_with_invalid.txt b/rskj-core/src/test/resources/dsl/transient_storage_rskip446/dynamic_execution_context_with_invalid.txt index 96321e7ead..6064b09506 100644 --- a/rskj-core/src/test/resources/dsl/transient_storage_rskip446/dynamic_execution_context_with_invalid.txt +++ b/rskj-core/src/test/resources/dsl/transient_storage_rskip446/dynamic_execution_context_with_invalid.txt @@ -106,19 +106,6 @@ transaction_build txExecuteCallCode gas 500000 build -# Create block to hold txExecuteCallCode transaction -block_build b02 - parent b01 - transactions txExecuteCallCode - gasLimit 550000 - build - -# Connect block -block_connect b02 - -# Check b02 is best block -assert_best b02 - # Create transaction to execute txExecuteDelegateCall transaction transaction_build txExecuteDelegateCall sender acc1 @@ -129,19 +116,6 @@ transaction_build txExecuteDelegateCall gas 500000 build -# Create block to hold txExecuteDelegateCall transaction -block_build b03 - parent b02 - transactions txExecuteDelegateCall - gasLimit 550000 - build - -# Connect block -block_connect b03 - -# Check b03 is best block -assert_best b03 - # Create transaction to execute txExecuteDelegateCall transaction transaction_build txExecuteCall sender acc1 @@ -152,15 +126,15 @@ transaction_build txExecuteCall gas 500000 build -# Create block to hold txExecuteCall transaction -block_build b04 - parent b03 - transactions txExecuteCall - gasLimit 550000 +# Create block to hold transactions +block_build b02 + parent b01 + transactions txExecuteCallCode txExecuteDelegateCall txExecuteCall + gasLimit 2000000 build # Connect block -block_connect b04 +block_connect b02 -# Check b04 is best block -assert_best b04 \ No newline at end of file +# Check b02 is best block +assert_best b02 \ No newline at end of file diff --git a/rskj-core/src/test/resources/dsl/transient_storage_rskip446/dynamic_execution_context_with_revert.txt b/rskj-core/src/test/resources/dsl/transient_storage_rskip446/dynamic_execution_context_with_revert.txt index 39ba6b71be..0544633606 100644 --- a/rskj-core/src/test/resources/dsl/transient_storage_rskip446/dynamic_execution_context_with_revert.txt +++ b/rskj-core/src/test/resources/dsl/transient_storage_rskip446/dynamic_execution_context_with_revert.txt @@ -106,19 +106,6 @@ transaction_build txExecuteCallCode gas 500000 build -# Create block to hold txExecuteCallCode transaction -block_build b02 - parent b01 - transactions txExecuteCallCode - gasLimit 550000 - build - -# Connect block -block_connect b02 - -# Check b02 is best block -assert_best b02 - # Create transaction to execute txExecuteDelegateCall transaction transaction_build txExecuteDelegateCall sender acc1 @@ -129,20 +116,7 @@ transaction_build txExecuteDelegateCall gas 500000 build -# Create block to hold txExecuteDelegateCall transaction -block_build b03 - parent b02 - transactions txExecuteDelegateCall - gasLimit 550000 - build - -# Connect block -block_connect b03 - -# Check b03 is best block -assert_best b03 - -# Create transaction to execute txExecuteDelegateCall transaction +# Create transaction to execute txExecuteCall transaction transaction_build txExecuteCall sender acc1 nonce 3 @@ -152,15 +126,15 @@ transaction_build txExecuteCall gas 500000 build -# Create block to hold txExecuteCall transaction -block_build b04 - parent b03 - transactions txExecuteCall - gasLimit 550000 +# Create block to hold transactions +block_build b02 + parent b01 + transactions txExecuteCallCode txExecuteDelegateCall txExecuteCall + gasLimit 2000000 build # Connect block -block_connect b04 +block_connect b02 -# Check b04 is best block -assert_best b04 \ No newline at end of file +# Check b02 is best block +assert_best b02 \ No newline at end of file diff --git a/rskj-core/src/test/resources/dsl/transient_storage_rskip446/dynamic_execution_context_with_stack_overflow.txt b/rskj-core/src/test/resources/dsl/transient_storage_rskip446/dynamic_execution_context_with_stack_overflow.txt index 8b937302c2..040e714320 100644 --- a/rskj-core/src/test/resources/dsl/transient_storage_rskip446/dynamic_execution_context_with_stack_overflow.txt +++ b/rskj-core/src/test/resources/dsl/transient_storage_rskip446/dynamic_execution_context_with_stack_overflow.txt @@ -113,19 +113,6 @@ transaction_build txExecuteCallCode gas 500000 build -# Create block to hold txExecuteCallCode transaction -block_build b02 - parent b01 - transactions txExecuteCallCode - gasLimit 550000 - build - -# Connect block -block_connect b02 - -# Check b02 is best block -assert_best b02 - # Create transaction to execute txExecuteDelegateCall transaction transaction_build txExecuteDelegateCall sender acc1 @@ -136,19 +123,6 @@ transaction_build txExecuteDelegateCall gas 500000 build -# Create block to hold txExecuteDelegateCall transaction -block_build b03 - parent b02 - transactions txExecuteDelegateCall - gasLimit 550000 - build - -# Connect block -block_connect b03 - -# Check b03 is best block -assert_best b03 - # Create transaction to execute txExecuteDelegateCall transaction transaction_build txExecuteCall sender acc1 @@ -159,15 +133,15 @@ transaction_build txExecuteCall gas 500000 build -# Create block to hold txExecuteCall transaction -block_build b04 - parent b03 - transactions txExecuteCall - gasLimit 550000 +# Create block to hold transactions +block_build b02 + parent b01 + transactions txExecuteCallCode txExecuteDelegateCall txExecuteCall + gasLimit 2000000 build # Connect block -block_connect b04 +block_connect b02 -# Check b04 is best block -assert_best b04 \ No newline at end of file +# Check b02 is best block +assert_best b02 \ No newline at end of file diff --git a/rskj-core/src/test/resources/dsl/transient_storage_rskip446/dynamic_reentrancy_context_tstore_before_revert_or_invalid_has_no_effect.txt b/rskj-core/src/test/resources/dsl/transient_storage_rskip446/dynamic_reentrancy_context_tstore_before_revert_or_invalid_has_no_effect.txt index 68e2c9996b..8d784690e4 100644 --- a/rskj-core/src/test/resources/dsl/transient_storage_rskip446/dynamic_reentrancy_context_tstore_before_revert_or_invalid_has_no_effect.txt +++ b/rskj-core/src/test/resources/dsl/transient_storage_rskip446/dynamic_reentrancy_context_tstore_before_revert_or_invalid_has_no_effect.txt @@ -84,19 +84,6 @@ transaction_build txTstorageDynamicReentrancyContextContract gas 1000000 build -# Create block to hold txTstorageDynamicReentrancyContextContract transaction -block_build b01 - parent g00 - transactions txTstorageDynamicReentrancyContextContract - gasLimit 1200000 - build - -# Connect block -block_connect b01 - -# Check b01 is best block -assert_best b01 - # Create transaction to execute txTestReentrantContextRevert transaction transaction_build txTestReentrantContextRevert sender acc1 @@ -107,19 +94,6 @@ transaction_build txTestReentrantContextRevert gas 300000 build -# Create block to hold txTestReentrantContextRevert transaction -block_build b02 - parent b01 - transactions txTestReentrantContextRevert - gasLimit 350000 - build - -# Connect block -block_connect b02 - -# Check b02 is best block -assert_best b02 - # Create transaction to execute txTestReentrantContextInvalid transaction transaction_build txTestReentrantContextInvalid transaction sender acc1 @@ -131,14 +105,14 @@ transaction_build txTestReentrantContextInvalid transaction build # Create block to hold txTestReentrantContextInvalid transaction -block_build b03 - parent b02 - transactions txTestReentrantContextInvalid - gasLimit 1200000 +block_build b01 + parent g00 + transactions txTstorageDynamicReentrancyContextContract txTestReentrantContextRevert txTestReentrantContextInvalid + gasLimit 3000000 build # Connect block -block_connect b03 +block_connect b01 -# Check b03 is best block -assert_best b03 \ No newline at end of file +# Check b01 is best block +assert_best b01 \ No newline at end of file diff --git a/rskj-core/src/test/resources/dsl/transient_storage_rskip446/in_constructor_and_deploy_code_create_context.txt b/rskj-core/src/test/resources/dsl/transient_storage_rskip446/in_constructor_and_deploy_code_create_context.txt index 75461e5b2f..e8d276915b 100644 --- a/rskj-core/src/test/resources/dsl/transient_storage_rskip446/in_constructor_and_deploy_code_create_context.txt +++ b/rskj-core/src/test/resources/dsl/transient_storage_rskip446/in_constructor_and_deploy_code_create_context.txt @@ -105,19 +105,6 @@ transaction_build txTestTransientStorageCreateContextsContract gas 1000000 build -# Create block to hold txTestTransientStorageCreateContextsContract transaction -block_build b01 - parent g00 - transactions txTestTransientStorageCreateContextsContract - gasLimit 1200000 - build - -# Connect block -block_connect b01 - -# Check b01 is best block -assert_best b01 - # Create transaction to execute txInConstructorAndCode transaction transaction_build txInConstructorAndCode sender acc1 @@ -129,14 +116,14 @@ transaction_build txInConstructorAndCode build # Create block to hold txInConstructorAndCode transaction -block_build b02 - parent b01 - transactions txInConstructorAndCode +block_build b01 + parent g00 + transactions txTestTransientStorageCreateContextsContract txInConstructorAndCode gasLimit 3000000 build # Connect block -block_connect b02 +block_connect b01 -# Check b02 is best block -assert_best b02 \ No newline at end of file +# Check b01 is best block +assert_best b01 \ No newline at end of file diff --git a/rskj-core/src/test/resources/dsl/transient_storage_rskip446/reentrancy_context_tstore_after_reentrant_call.txt b/rskj-core/src/test/resources/dsl/transient_storage_rskip446/reentrancy_context_tstore_after_reentrant_call.txt index 9206a0fc71..eee111ba94 100644 --- a/rskj-core/src/test/resources/dsl/transient_storage_rskip446/reentrancy_context_tstore_after_reentrant_call.txt +++ b/rskj-core/src/test/resources/dsl/transient_storage_rskip446/reentrancy_context_tstore_after_reentrant_call.txt @@ -71,19 +71,6 @@ transaction_build txTstorageReentrancyContextTestContract gas 1000000 build -# Create block to hold txTstorageReentrancyContextTestContract transaction -block_build b01 - parent g00 - transactions txTstorageReentrancyContextTestContract - gasLimit 1200000 - build - -# Connect block -block_connect b01 - -# Check b01 is best block -assert_best b01 - # Create transaction to execute txTstoreInReentrantCall transaction transaction_build txTstoreInReentrantCall sender acc1 @@ -94,19 +81,6 @@ transaction_build txTstoreInReentrantCall gas 300000 build -# Create block to hold txTstoreInReentrantCall transaction -block_build b02 - parent b01 - transactions txTstoreInReentrantCall - gasLimit 350000 - build - -# Connect block -block_connect b02 - -# Check b02 is best block -assert_best b02 - # Create transaction to execute txCheckValuesStoredInTstorage transaction transaction_build txCheckValuesStoredInTstorage transaction sender acc1 @@ -118,14 +92,14 @@ transaction_build txCheckValuesStoredInTstorage transaction build # Create block to hold txCheckValuesStoredInTstorage transaction -block_build b03 - parent b02 - transactions txCheckValuesStoredInTstorage - gasLimit 350000 +block_build b01 + parent g00 + transactions txTstorageReentrancyContextTestContract txTstoreInReentrantCall txCheckValuesStoredInTstorage + gasLimit 3500000 build # Connect block -block_connect b03 +block_connect b01 -# Check b03 is best block -assert_best b03 \ No newline at end of file +# Check b01 is best block +assert_best b01 \ No newline at end of file