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

Investigate cause of nondeterminism in gas usage #23

Open
0xekez opened this issue Apr 3, 2023 · 4 comments
Open

Investigate cause of nondeterminism in gas usage #23

0xekez opened this issue Apr 3, 2023 · 4 comments
Labels

Comments

@0xekez
Copy link
Contributor

0xekez commented Apr 3, 2023

To reproduce, change ACK_GAS_NEEDED to a low number in contracts/voice/ibc.rs, then run the test suite a couple times noticing that the gas_used error message has a different value on each failure. You can verify in the just simtest output that the contract hashes are the same.

This is relevant because we hand tune the ACK_GAS_NEEDED parameter. If gas_used is non-deterministic, can someone induce this non-determinism to move gas usage in a particular direction? We need to be sure that an attacker can't control this non-determinism and cause ACKs not to be returned.

@0xekez
Copy link
Contributor Author

0xekez commented Apr 10, 2023

second paragraph of this discusses how gas is selected. experiment: check if gas usage non-determinism changes if the hardware changes.

@0xekez
Copy link
Contributor Author

0xekez commented Apr 10, 2023

part of this work is to make wiki page describing updates to gas usage by x/gov and how to handle them.

@Art3miX
Copy link
Collaborator

Art3miX commented Apr 10, 2023

check if gas usage non-determinism changes if the hardware changes.

Maybe create a test that just return average gas consumption over 100 msgs or so, and we can test it on different devices and return the results here

@Art3miX
Copy link
Collaborator

Art3miX commented Apr 13, 2023

@0xekez out of gas in location: WritePerByte; gasWanted: 3000000, gasUsed: 3000250: out of gas

Can you test it on your end and make sure its passing on my branch for you? (just simtest)

Edit: Only happened once, without playing with any gas values.

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

No branches or pull requests

2 participants