3

Ethereum validators set a withdrawal address to automatically receive their staking rewards. These rewards are distributed gas free at the protocol level through a process called "validator sweeping."

What happens if instead of setting an EOA address as the withdrawal address, a user inputs a smart contract address that contains a fallback function?

  • Would the fallback function fail?
  • If the fallback function is able to be executed, is the gas costs of the function also covered at the protocol level for free by the "sweep?"
  • Is the cost debited from the withdrawn ETH?

2 Answers 2

2

If a validator do that the rewards are indeed sent to that smart contract but the process of validator sweeping does not interact with the contract's fallback function. The rewards are just directly sent to the contract address and does not trigger any code execution, the reason for that is at the protocol level outside of the EVM and it is gas free.

2

EIP-4895 has a couple explanations to @Saxtheowl's good answer.

Why only balance updates? No general EVM execution?

More general processing introduces the risk of failures, which complicates accounting on the beacon chain.

This EIP suggests a route for withdrawals that provides most of the benefits for a minimum of the (complexity) cost.

Why no (gas) costs for the withdrawal type?

The maximum number of withdrawals that can reach the execution layer at a given time is bounded (enforced by the consensus layer) and this limit has been chosen so that any execution layer operational costs are negligible in the context of the broader payload execution.

This bound applies to both computational cost (only a few balance updates in the state) and storage/networking cost as the additional payload footprint is kept small (current parameterizations put the additional overhead at ~1% of current average payload size).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.