stellar-core icon indicating copy to clipboard operation
stellar-core copied to clipboard

Improve Soroban I/O controls in loadgen

Open dmkozh opened this issue 11 months ago • 1 comments

Currently Soroban loadgen allows us to configure the number of entries to write and the total amount of kilobytes to write. However, when computing the inputs to the loadgen contract, we round up the size of every entry written to 1 KB. So e.g. if we request to write 10 entries with the write bytes limit of 3KB, then the contract will try writing 10 KB worth of data and fail due to exceeding the transaction write limit. We should increase granularity of the contract inputs, for example:

  • Make contract accept the size of each entry written in bytes
  • Compute the per-entry size on the loadgen side:
    • Make sure to account for the 'baseline' entry size (~50B) when computing the size to pass to the contract. It's fine for entry to have 0-byte payload
    • Increase the transaction write bytes if necessary to be at least baseline_entry_size * num_entries_written.
    • Estimate the instructions using the final write bytes values (rounding up to 1 KB)

It also would be nice to control the read entries separately from the write entries. It should be sufficient to simply allow us to configure the number of read bytes/read entries separately and add the extra entries to the footprint (on top of the RW entries).

dmkozh avatar Mar 07 '24 19:03 dmkozh

Hey @dmkozh, I've got a couple clarifying questions:

  1. Where does the existing loadgen contract perform reads? I see writes to persistent storage here, but no corresponding reads. Is there an implicit read somewhere?
  2. Can you expand a bit on the per-entry "baseline" data? What is this data? Metadata about the entry? How can I tell how big it is?

bboston7 avatar Mar 20 '24 19:03 bboston7