From 6672dd34d8353e5c2eee75e38c1c4447efc0db68 Mon Sep 17 00:00:00 2001 From: anupsdf Date: Wed, 20 Nov 2024 13:59:32 -0800 Subject: [PATCH] Separate cell for Soroban limits --- scripts/resource-calc.ipynb | 27 ++++++++++++++++++++------- 1 file changed, 20 insertions(+), 7 deletions(-) diff --git a/scripts/resource-calc.ipynb b/scripts/resource-calc.ipynb index 032a74d58d..7dae97dfbb 100644 --- a/scripts/resource-calc.ipynb +++ b/scripts/resource-calc.ipynb @@ -9,7 +9,20 @@ }, { "cell_type": "code", - "execution_count": 102, + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "########### Soroban limits\n", + "SOROBAN_READ_ENTRIES_PER_TX = 40\n", + "SOROBAN_WRITE_ENTRIES_PER_TX = 25\n", + "SOROBAN_WRITE_BYTES_PER_TX = 129*1024\n", + "SOROBAN_EVENT_SIZE_PER_TX = 16*1024" + ] + }, + { + "cell_type": "code", + "execution_count": null, "metadata": {}, "outputs": [], "source": [ @@ -48,15 +61,15 @@ "\n", " # soroban\n", " # max number of LE reads\n", - " LE_reads_per_op['soroban'] = 40\n", + " LE_reads_per_op['soroban'] = SOROBAN_READ_ENTRIES_PER_TX\n", " # max number of LE writes\n", - " LE_writes_per_op['soroban'] = 25\n", + " LE_writes_per_op['soroban'] = SOROBAN_WRITE_ENTRIES_PER_TX\n", " # write as much as possible, use max allowed per tx\n", " # note that this also impacts the total of amount read per tx\n", " # but as tx also need to load wasm blobs, in average is probably fine\n", - " LE_size['soroban'] = (129*1024)/LE_writes_per_op['soroban']\n", + " LE_size['soroban'] = (SOROBAN_WRITE_BYTES_PER_TX) / LE_writes_per_op['soroban']\n", " # max event produced\n", - " event_size_per_op['soroban'] = 16*1024\n", + " event_size_per_op['soroban'] = SOROBAN_EVENT_SIZE_PER_TX\n", "\n", " # speedex\n", " LE_reads_per_op['speedex'] = 4\n", @@ -81,9 +94,9 @@ " # avg number of LE writes\n", " LE_writes_per_op['soroban'] = 5\n", " # use a 10th of capacity\n", - " LE_size['soroban'] = (129*1024)/LE_writes_per_op['soroban']/10\n", + " LE_size['soroban'] = SOROBAN_WRITE_BYTES_PER_TX / LE_writes_per_op['soroban']/10\n", " # event produced is 50% of max\n", - " event_size_per_op['soroban'] = 16*1024/2\n", + " event_size_per_op['soroban'] = SOROBAN_EVENT_SIZE_PER_TX / 2\n", "\n", " # speedex\n", " LE_reads_per_op['speedex'] = 4\n",