Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Charge gas to unzip wasm code #898

Merged
merged 4 commits into from
Aug 31, 2022
Merged

Charge gas to unzip wasm code #898

merged 4 commits into from
Aug 31, 2022

Conversation

alpe
Copy link
Contributor

@alpe alpe commented Jul 7, 2022

Uncompressing packed wasm code should be paid in gas to compensate for CPU.

Early version for feedback. Left to do:
- Set proper cost per byte value

Not included is an ante handler to verify gas. But we don't do this for costs per bytes either.

@codecov
Copy link

codecov bot commented Jul 7, 2022

Codecov Report

Merging #898 (4c40d1e) into main (6423488) will decrease coverage by 0.02%.
The diff coverage is 66.66%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #898      +/-   ##
==========================================
- Coverage   59.34%   59.31%   -0.03%     
==========================================
  Files          51       51              
  Lines        6221     6229       +8     
==========================================
+ Hits         3692     3695       +3     
- Misses       2264     2268       +4     
- Partials      265      266       +1     
Impacted Files Coverage Δ
app/test_helpers.go 0.82% <ø> (ø)
x/wasm/keeper/snapshotter.go 64.70% <0.00%> (-1.97%) ⬇️
x/wasm/keeper/keeper.go 88.57% <54.54%> (-0.10%) ⬇️
x/wasm/ioutils/ioutil.go 86.66% <66.66%> (-13.34%) ⬇️
x/wasm/ioutils/utils.go 71.42% <100.00%> (ø)
x/wasm/keeper/gas_register.go 97.53% <100.00%> (+0.23%) ⬆️

@alpe alpe requested review from pinosu and webmaster128 July 8, 2022 13:00
@alpe alpe marked this pull request as ready for review July 8, 2022 13:00
Copy link
Member

@webmaster128 webmaster128 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. Some questions and suggestions.

x/wasm/keeper/gas_register.go Outdated Show resolved Hide resolved
x/wasm/ioutils/utils.go Outdated Show resolved Hide resolved
x/wasm/keeper/keeper.go Outdated Show resolved Hide resolved
x/wasm/keeper/snapshotter.go Show resolved Hide resolved
@ethanfrey ethanfrey added this to the v0.29.0 milestone Aug 15, 2022
@faddat
Copy link
Contributor

faddat commented Aug 25, 2022

The reasoning behind this one is super-solid.

@alpe alpe force-pushed the uncompress_costs branch from f8991bc to 46d9e25 Compare August 25, 2022 10:42
@alpe alpe force-pushed the uncompress_costs branch from 46d9e25 to e110d4b Compare August 25, 2022 10:48
@alpe
Copy link
Contributor Author

alpe commented Aug 25, 2022

I have applied the feedback and rebased the branch on top of main.

Copy link
Contributor

@pinosu pinosu left a comment

Choose a reason for hiding this comment

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

Good work! 💯

@alpe alpe requested a review from webmaster128 August 26, 2022 07:08
Copy link
Member

@webmaster128 webmaster128 left a comment

Choose a reason for hiding this comment

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

🐎

@alpe alpe merged commit e714fdf into main Aug 31, 2022
@alpe alpe deleted the uncompress_costs branch August 31, 2022 14:17
@faddat faddat mentioned this pull request Oct 2, 2022
conorpp pushed a commit to wormhole-foundation/wasmd that referenced this pull request Feb 1, 2023
* Charge gas for unzip wasm code

* Add uncompress test

* Apply review feedback

* Add testcase to uncompress spec
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants