Account gas storage opcodes
Allows contract accounts to store gas that can be transferred to the refund counter.
Contracts can persist gas for later transfer to the refund counter. Three opcodes are introduced to read, add to, and use this gas counter.
The refund mechanism is currently being used by gas tokens to arbitrage gas price. This brings gas supply elasticity and price stability by moving gas from blocks with less demand to blocks with more demand. Unfortunately this rewards unnecessary state growth. By introducing a superior gas storage mechanism, the gas market will require less storage and computation.
Contract accounts gain an unsigned gas refund counter, initially zero.
Three new opcodes are introduced to manage this state.
0x49): Pushes the current account's gas refund counter onto the stack. Shares gas pricing with
amountfrom the stack. The minimum of
amountand the current account's gas refund counter is transferred to the execution context's refund counter. Costs
amountfrom the stack. Costs
5000 + amountgas. Increases the current account's gas refund counter by
By reusing the execution context's refund counter we can reuse its 50% DoS protection, which limits its block elasticity contribution to 2x.
The gas costs are based on similar opcodes
Most accounts will store no gas, so the per-account storage overhead should be minimal or even zero in the normal case.
The opcode numbers chosen are in the same
0x4X range as
Because the gas is added to the refund counter, no compatibility issues are anticipated.
DoS is already limited by the 50% refund limit.
Copyright and related rights waived via CC0.
不想错过最新的 EIP 动态？
订阅 EIPs Fun 周刊以跟进相关更新，建⽴你与 EIP 之间的连接 ，更好地建设以太坊。详情