-
Notifications
You must be signed in to change notification settings - Fork 30
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
contracts: add gaspad and gasused precompiles #205
Conversation
I'm considering the threat model of the gas attacks. By using the new |
I'm not sure about the threat model for an adversarial node. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you make the naming consistent with the rust code?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should also add this to:
- https://github.com/oasisprotocol/docs/blob/main/docs/dapp/sapphire/precompiles.md
- extend our docs chapter to cover the usage of gas padding (https://docs.oasis.io/dapp/sapphire/guide#writing-secure-dapps ? )
- extend one of the examples to also cover this (demo-voting, demo-starter?) or write a new one
3fffb78
to
5d11ac8
Compare
…edarMist/gaspad contracts: add gaspad and gasused precompiles bcecd07
…darMist/gaspad contracts: add gaspad and gasused precompiles bcecd07
Unfortunately this has different semantics than was initially intended as the initial gas cost for the calldata is added after the transaction is executed.
This means that there will be a 12 gas difference, even after padding, between every NULL and non-NULL byte of the calldata. While this has a very small impact and won't reveal too much sensitive information, it will still reveal some information about the encrypted calldata.
A suggested workaround is to add
bytes calldata fuz
argument and filling it with one non-zero byte for every zero byte in the other arguments.