Refresh mainnet() resource limits and fees - #1946
Conversation
|
CI note: the The example lives in Generated by Claude Code |
6731fc8 to
fceecc7
Compare
fceecc7 to
fe58f3c
Compare
|
I'm opening to merging this in a patch release given an experience of this is that it is surprising. But also, it could break peoples tests as it does for the soroban-examples, in which case it would be better to hold this for the v28 release and merge it just prior. |
There was a problem hiding this comment.
Pull request overview
Refreshes hardcoded Mainnet resource limits and fee estimates to the 2026-07-10 network settings.
Changes:
- Updates invocation limits and fee/rent parameters.
- Refreshes fee expectation snapshots and rustdocs.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
soroban-sdk/src/testutils/cost_estimate.rs |
Updates Mainnet limits, fees, and documentation. |
soroban-sdk/src/tests/cost_estimate.rs |
Updates expected fee calculations. |
|
The soroban-example failures are being fixed in: |
mootz12
left a comment
There was a problem hiding this comment.
Good catch on this drift.
Should we cache this for the user during test runs or something instead of requiring a release? We can expire it on some window.
This value changes unrelated to protocol upgrades, so I don't think tying it to SDK releases is the best.
This is an interesting idea. There would need to be some built in defaults to apply when used offline. And test reproducibility is really important so it would be important that once a test ran once with limits that it ran every future time with the same values until a user took action to update it. I guess we could have built in defaults and write them to a .json file that gets committed with the project. Is that what you had in mind? |
For this reason I don't think it should be tied to major releases, and so we can release it with a patch release as a bug fix / tweak. |
|
If there was a way to get the limits at a ledger number, then it could be convenience to cache a past limit in, but then you could get the limit for a given ledger number in your test that would be cached. That makes the values less arbitrary. |
What
Refresh the
InvocationResourceLimits::mainnet()limits and the fee-rate snapshot used byCostEstimate::fee()to the Stellar Mainnet settings as of 2026-07-10, and update their rustdocs (including the duplicated limits table in the v25 resource-limits migration guide) to point readers tostellar network settings --network mainnetand Stellar Lab as the live source of truth.Why
InvocationResourceLimits::mainnet()has been enforced byEnv::default()on every test invocation since v25 but still carried the values from when resource-limit enforcement was first introduced, which had drifted from Mainnet in both directions: the instruction ceiling was too high (600,000,000 vs 400,000,000), letting a contract pass tests yet exceed Mainnet's per-transaction limit in production and defeating the early-warning purpose of the enforcement, while the entry ceilings were too low (disk read entries 100 vs 200, write entries 50 vs 200, ledger entries 100 vs 400).Known limitations
The values remain a hardcoded snapshot rather than being pulled dynamically, so they will drift again.
On the one hand this is bad, but also, if they kept moving tests could become flakey, so timing this update with new major releases on some cadence is probably a good idea.
Follow up to introduce CI to help us keep it updated: