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

Accurate recipient charging is not feasible #142

Closed
nventuro opened this issue Jun 21, 2019 · 1 comment
Closed

Accurate recipient charging is not feasible #142

nventuro opened this issue Jun 21, 2019 · 1 comment

Comments

@nventuro
Copy link
Collaborator

There's an issue with assuming that the "gas overhead" of relaying is constant. This gas overhead is what can't be measured on-chain by using gasleft in relayCall, and includes stuff like the Solidity function dispatch code and the base transaction fee.

The issue we've identified is that the gas overhead includes the transaction data fee, which is 68 gas per non zero byte and 4 gas per zero byte, which is dynamic, highly variable, and can't be cheaply calculated on chain.

As a workaround we can use a constant value as overhead, representing the average case, economically forcing relays to check off-chain that the specific encodedData is not unreasonably high. It could simply reject such requests, or only accept them if the transaction fee is large enough. Relays with higher transaction fees may be more lax in this requirement.

@drortirosh
Copy link
Member

I think the workaround is good enough.
maybe we can add off-chain helper for the client (and relay) to calculate "reasonable" txfee for abnormal transactions.

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

No branches or pull requests

2 participants