The overhead gas cost is the extra amount of gas required to process the relay call requested by the user. Let’s call X the gas consumed by the destination-contract method call, and Y the total gas consumed by the relay call, then the relay call cost (i.e. overhead gas cost) is: Z = Y - X.
RIF Enveloping V1 only has one SmartWallet template, which can be used as-is or it can be injected with extra logic during the SmartWallet instance creation.
V2 introduces a cheaper template (SimpleSmartWallet), to be used when there’s no need for extra custom-logic in the smart wallets. The behaviour is the same as the SmartWallet template of V2, but without this capability.
|RIF Version||SW template||Avg. overhead gas|
Note that the instance of SmartWallet used didn’t point to any extra custom logic.
RIF Enveloping V2 also introduces transaction batching
Each transaction has the same smart wallet, token payment and destination contract.
Each transaction has the same smart wallet, token payment but each has a different destination contract
The gas costs for scenarios A and B are the same.
Each transaction has a different smart wallet, but the token payment and destination contract are the same.
Each transaction has a different smart wallet and destination contract, but the same token payment
The gas costs for scenarios C and D are the same.
Each transaction has a different smart wallet and token payment but the same destination contract.
Each transaction has a different smart wallet, token payment and destination contract
The gas costs for scenarios E and F are the same.
The following table depicts the average gas overhead per transaction for the SimpleSmartWallet template when using transaction batching The gas difference of using the SmartWallet template without extra logic versus using the SimpleSmartWallet template is approximately an extra of between 200 and 300 gas.
|Tx per batch||A,B||C,D||E,F|
|9||49495||62760||to be continued (new contract update in progress)|
Go to top