@@ -1069,10 +1069,23 @@ TEST_CASE("applicable txset validation - Soroban resources", "[txset][soroban]")
1069
1069
op.body .type (INVOKE_HOST_FUNCTION);
1070
1070
op.body .invokeHostFunctionOp ().hostFunction .type (
1071
1071
HOST_FUNCTION_TYPE_UPLOAD_CONTRACT_WASM);
1072
+
1073
+ // Make sure that our transactions are large enough so our upgrade
1074
+ // maintains at least the minimum required max tx size
1075
+ auto randomWasm = rust_bridge::get_random_wasm (
1076
+ MinimumSorobanNetworkConfig::TX_MAX_SIZE_BYTES, 0 );
1077
+ op.body .invokeHostFunctionOp ().hostFunction .wasm ().insert (
1078
+ op.body .invokeHostFunctionOp ().hostFunction .wasm ().begin (),
1079
+ randomWasm.data .data (),
1080
+ randomWasm.data .data () + randomWasm.data .size ());
1081
+
1072
1082
SorobanResources resources;
1073
- resources.instructions = 1'000'000 ;
1083
+ resources.instructions =
1084
+ MinimumSorobanNetworkConfig::TX_MAX_INSTRUCTIONS;
1074
1085
resources.readBytes = 5'000 ;
1075
- resources.writeBytes = 2'000 ;
1086
+ resources.writeBytes =
1087
+ MinimumSorobanNetworkConfig::TX_MAX_WRITE_BYTES;
1088
+
1076
1089
for (int i = 0 ; i < 8 ; ++i)
1077
1090
{
1078
1091
resources.footprint .readOnly .push_back (
@@ -1110,13 +1123,34 @@ TEST_CASE("applicable txset validation - Soroban resources", "[txset][soroban]")
1110
1123
// accommodate 20 txs created by `createTx()`.
1111
1124
modifySorobanNetworkConfig (
1112
1125
*app, [&](SorobanNetworkConfig& sorobanCfg) {
1113
- sorobanCfg.mLedgerMaxInstructions = 20 * 1'000'000 ;
1114
- sorobanCfg.mLedgerMaxReadBytes = 20 * 5000 ;
1115
- sorobanCfg.mLedgerMaxWriteBytes = 20 * 2000 ;
1116
- sorobanCfg.mLedgerMaxReadLedgerEntries = 20 * 10 ;
1117
- sorobanCfg.mLedgerMaxWriteLedgerEntries = 20 * 2 ;
1118
- sorobanCfg.mLedgerMaxTxCount = 20 ;
1119
- sorobanCfg.mLedgerMaxTransactionsSizeBytes = 20 * txSize;
1126
+ auto const txCount = 20 ;
1127
+ sorobanCfg.mLedgerMaxTxCount = txCount;
1128
+
1129
+ sorobanCfg.mTxMaxInstructions =
1130
+ MinimumSorobanNetworkConfig::TX_MAX_INSTRUCTIONS;
1131
+ sorobanCfg.mLedgerMaxInstructions =
1132
+ txCount * sorobanCfg.mTxMaxInstructions ;
1133
+
1134
+ sorobanCfg.mTxMaxReadBytes = 5000 ;
1135
+ sorobanCfg.mLedgerMaxReadBytes =
1136
+ txCount * sorobanCfg.mTxMaxReadBytes ;
1137
+
1138
+ sorobanCfg.mTxMaxWriteBytes =
1139
+ MinimumSorobanNetworkConfig::TX_MAX_WRITE_BYTES;
1140
+ sorobanCfg.mLedgerMaxWriteBytes =
1141
+ txCount * sorobanCfg.mTxMaxWriteBytes ;
1142
+
1143
+ sorobanCfg.mTxMaxReadLedgerEntries = 10 ;
1144
+ sorobanCfg.mLedgerMaxReadLedgerEntries =
1145
+ txCount * sorobanCfg.mTxMaxReadLedgerEntries ;
1146
+
1147
+ sorobanCfg.mTxMaxWriteLedgerEntries = 2 ;
1148
+ sorobanCfg.mLedgerMaxWriteLedgerEntries =
1149
+ txCount * sorobanCfg.mTxMaxWriteLedgerEntries ;
1150
+
1151
+ sorobanCfg.mTxMaxSizeBytes = txSize;
1152
+ sorobanCfg.mLedgerMaxTransactionsSizeBytes =
1153
+ txCount * sorobanCfg.mTxMaxSizeBytes ;
1120
1154
1121
1155
if (protocolVersionStartsFrom (
1122
1156
protocolVersion,
0 commit comments