reth: Discuss: How to handle block reward to miner

If there is transactions present inside block we could just add block reward (2eth) to last transaction change set.

The problem is how to handle it if there are no transactions inside block, we still need index for transaction to index validator account balance change.

Do we always include +1 transaction changeset for validator block reward? In that case index of transactions would always be body.len()+1. This could probably work but want others to be aware of it if we do it this way.

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 15 (5 by maintainers)

Most upvoted comments

Ok got it, bringing the summary I got from discord: we’d be incrementing the CumulativeTxCount for the reward resulting in the following:

Tx1=1
Tx2=2
Block1Reward=3
Block2Reward=4
Tx3=5
Block3Reward=6

Sgtm. Concept ack, would like @joshieDo thoughts.

Is there a footgun exposed as a result of that in our internal apis? If somebody wants to talk to the db directly, what do they need to be aware of?

just fyi the block reward has also varied over time, and is not always 2 ETH

but yeah, I didn’t realize the intent was to support stuff from before the merge 😃