Skip to content

Conversation

@Villaquiranm
Copy link
Contributor

@Villaquiranm Villaquiranm commented Aug 27, 2025

While working on #79, I encountered several issues that needed to be addressed before reaching the out-of-gas for transactions part:

  1. Instead of the expected error
    unable to construct transactions, unable to estimate gas, error encountered during gas estimation: out of gas error 🤠

I received an InternalError:

/std.InternalError"�0recovered: gnomod.toml not found for package "gno.land/r/g1jg8mtutu9khhfwc4nxmuhcpftf0pajdhfvsqf5/stress_1756304458"

It seems that all packages are now required to have a gnomod.toml.

  1. Wrong Number of Arguments in Realm Calls
    When simulating with REALM_CALL mode, I got:
    /std.InternalError"�-recovered: wrong number of arguments in call to SayHello: want 1 got 2

This was caused by the cross-realm modification, where realms now automatically receive a first parameter of type realm.
To fix this, I updated the function signatures across all realms.

  1. Out-of-Gas Transaction Handling

After resolving the above, I was able to focus on the out-of-gas transaction issue.

I introduced a new method on the Runtime interface that allows us to simulate and compute the total cost of all future transactions (based on the chosen Mode for the stress test).

Instead of funding test accounts with a fixed amount, we now:

  • Call this new method before funding
  • Replace the static funding amount with the precisely simulated gas amount
  • This ensures more accurate gas handling during stress tests.

@Villaquiranm Villaquiranm changed the title fix: simulate and compute total gas usage before distribution fix: simulate and compute total gas usage before token distribution Aug 27, 2025
@Villaquiranm
Copy link
Contributor Author

Villaquiranm commented Aug 28, 2025

@zivkovicmilos
Sorry just to let you know, need to do more tests, currently working with gnodev but failing in staging with this command
supernova -sub-accounts 2 -transactions 10 -chain-id staging -url https://rpc.staging.gno.land -mnemonic MNEMONIC
Edit:
✅ Fixed ecdad57

@Villaquiranm Villaquiranm force-pushed the fix/compute-gas-usage-before-distribution branch from 89a0129 to ecdad57 Compare August 28, 2025 19:02
@ajnavarro
Copy link
Contributor

The current work looks good. The only need is to fix the linter problems. Can you provide the error you are getting when testing on staging? Thanks.

@ajnavarro ajnavarro self-requested a review August 29, 2025 09:10
@sw360cab
Copy link
Contributor

The current work looks good. The only need is to fix the linter problems. Can you provide the error you are getting when testing on staging? Thanks.

I added this into a previous PR

https://github.com/gnolang/supernova/pull/86/files#diff-4b122024a3a28ded65da76a2f1bface1f3a27328374438d1298d25585fe0603b

don't know if I made it better or worse

@Villaquiranm
Copy link
Contributor Author

The current work looks good. The only need is to fix the linter problems. Can you provide the error you are getting when testing on staging? Thanks.

Thanks for the review:
The problem was that we were going out of gas even when simulating. So when simulating transactions I'm passing the maximum gas per block to compute the fee.
Later I pass this simulated gas to the real transaction
commit here ecdad57

@Villaquiranm Villaquiranm force-pushed the fix/compute-gas-usage-before-distribution branch from 5978fcb to 5a9cfbe Compare August 29, 2025 13:11
Copy link
Member

@MikaelVallenet MikaelVallenet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Member

@zivkovicmilos zivkovicmilos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good 💯

Just a few minor things to resolve 🙏

@Villaquiranm Villaquiranm force-pushed the fix/compute-gas-usage-before-distribution branch from 3349c82 to 257fe9d Compare September 2, 2025 09:13
@zivkovicmilos zivkovicmilos merged commit 67a5e38 into gnolang:main Sep 2, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

5 participants