You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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.
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
inrelayCall
, 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.The text was updated successfully, but these errors were encountered: