Skip to content

Commit

Permalink
Separate cell for Soroban limits
Browse files Browse the repository at this point in the history
  • Loading branch information
anupsdf authored and marta-lokhova committed Dec 13, 2024
1 parent e3c7a81 commit ceeb9b2
Showing 1 changed file with 20 additions and 7 deletions.
27 changes: 20 additions & 7 deletions scripts/resource-calc.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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": [
Expand Down Expand Up @@ -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",
Expand All @@ -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",
Expand Down

0 comments on commit ceeb9b2

Please sign in to comment.