namada icon indicating copy to clipboard operation
namada copied to clipboard

Improve gas interface

Open grarco opened this issue 1 year ago • 9 comments

Describe your changes

Closes #3427. Closes #3395.

Introduces a new WholeGas type to better distinguish between gas in subunits (for tracking) and gas in whole units (for events and fees).

Reduces the gas scale in the localnet genesis file and in tests by an order of magnitude to increase the gas cost of transactions which was too low.

Removes the redundant gas_used field of TxResult (since we already emit an attribute GasUsed) and collapse the previous BatchResults directly into TxResult.

Indicate on which release or other PRs this topic is based on

v0.40.0

Checklist before merging to draft

  • [x] I have added a changelog
  • [x] Git history is in acceptable state

grarco avatar Jun 19 '24 17:06 grarco

Codecov Report

Attention: Patch coverage is 73.17073% with 44 lines in your changes missing coverage. Please review.

Project coverage is 53.46%. Comparing base (8479d38) to head (826c2fc). Report is 4 commits behind head on main.

Files Patch % Lines
crates/node/src/bench_utils.rs 0.00% 13 Missing :warning:
crates/namada/src/ledger/protocol/mod.rs 70.00% 9 Missing :warning:
crates/gas/src/lib.rs 73.68% 5 Missing :warning:
crates/sdk/src/rpc.rs 0.00% 5 Missing :warning:
crates/tx/src/data/mod.rs 91.07% 5 Missing :warning:
crates/tx/src/data/wrapper.rs 62.50% 3 Missing :warning:
crates/node/src/shell/finalize_block.rs 87.50% 2 Missing :warning:
crates/light_sdk/src/reading/asynchronous/tx.rs 0.00% 1 Missing :warning:
crates/sdk/src/tx.rs 0.00% 1 Missing :warning:
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3428      +/-   ##
==========================================
- Coverage   53.48%   53.46%   -0.02%     
==========================================
  Files         320      320              
  Lines      110000   109974      -26     
==========================================
- Hits        58832    58803      -29     
- Misses      51168    51171       +3     

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov[bot] avatar Jun 19 '24 20:06 codecov[bot]

@yito88 Hermes tests failing again (sorry about that)

grarco avatar Jun 20 '24 11:06 grarco

@yito88 Hermes tests failing again (sorry about that)

Ah actually I believe the failures come from #3391

grarco avatar Jun 20 '24 11:06 grarco

yeah, it seems that the parameter structure change in #3391 causes the failure.

yito88 avatar Jun 20 '24 12:06 yito88

yeah, it seems that the parameter structure change in #3391 causes the failure.

Maybe not, I've just pushed a fix to that branch that was supposed to fix a failing ibc test (non-hermes) but it seems to have fixed all the e2e tests. So the issue might indeed come from this branch

grarco avatar Jun 20 '24 14:06 grarco

do we still want this PR?

brentstone avatar Jul 05 '24 22:07 brentstone

do we still want this PR?

I think it would be nice if we could add it to the next release

grarco avatar Jul 08 '24 16:07 grarco

@grarco Looks good. e2e::ibc_tests::run_ledger_ibc failed without Hermes. It seems that the default gas limit isn't enough for tx_ibc.wasm.

yito88 avatar Jul 09 '24 09:07 yito88

@grarco Looks good. e2e::ibc_tests::run_ledger_ibc failed without Hermes. It seems that the default gas limit isn't enough for tx_ibc.wasm.

Thanks for catching it! Should be fixed in fb81246a0e9179384bec1838f8a2229d17d09e64. I've also fixed the broken integration tests

grarco avatar Jul 09 '24 10:07 grarco