Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add opcode 0x46 blockreward #700

Merged
merged 4 commits into from
Mar 8, 2019
Merged

Conversation

realcodywburns
Copy link
Contributor

From #698 and #669

Simple Summary

This EIP adds an additional opcode to the EVM which will return a finalized blocks reward value.

See commits and files

@nicksavers
Copy link
Contributor

Comments in issue

@5chdn #698 (comment)

Doesn't this even make sense to include it in EIP-649 #669 ?

@realcodywburns #698 (comment)

It could be useful independent of 649. 649 seems more specifically focused on the mechanics of reward reduction on the mainnet ethereum surrounding the metro forks, whereas the opcode itself could be used universally: testnets and sister chains(etc, music, expanse, rootstock)

@realcodywburns #698 (comment)

For further clarity, BLOCKREWARD should return the total value of the Reward Applied(11.3) for block n as defined in section 11, Block Finalisation

@axic #698 (comment)

.... it could be useful to have a way to get both the basic and the total reward, perhaps as a single parameter to the opcode (enum or boolean?).

@vbuterin #698 (comment)

I don't think this is worth the effort at the moment given the impending PoS switch. Once the exact long term consensus incentivization structure is finalized, I think it would make more sense to revisit something like this.

@realcodywburns #698 (comment)

The PoS switch has been "impending" for quite some time and seems to be delayed a bit longer. This eip is also applicable to consortium chains, private chains, and others using multiple consensus algorithms.

@@ -0,0 +1,98 @@
## Preamble

EIP: <to be assigned>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use 698 and move this file to EIPS/eip-698.md.

@realcodywburns
Copy link
Contributor Author

Bump

* `0X44 DIFFICULTY`
* `0X45 GASLIMIT`

This EIP would add an additional opcode, `0x46 BLOCKREWARD`, which would return the block reward for any finalized block. The finalized block reward would include the base reward, uncle payments, and gas.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think it is possible to get the "final" block reward for the current block since total gas usage cannot be known in advance.


## Abstract

In the EVM, the 0x40 opcodes are reserved for `Block Information`. Currently reserved opcodes are:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this list relevant to the current EIP?

* Value: `0x46`
* Mnemonic: `BLOCKREWARD`
* δ:` 0` nothing removed from stack
* α:`1` block reward added to stack
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since the total reward cannot be known for the current block, it may be more useful to:

It may be possible to implement this change similar to how #210 is done, that would make it clear that all this detail can only be retrieved for past blocks.

@Arachnid
Copy link
Contributor

This is a courtesy notice to let you know that the format for EIPs has been modified slightly. If you want your draft merged, you will need to make some small changes to how your EIP is formatted:

  • Frontmatter is now contained between lines with only a triple dash ('---')
  • Headers in the frontmatter are now lowercase.

If your PR is editing an existing EIP rather than creating a new one, this has already been done for you, and you need only rebase your PR.

In addition, a continuous build has been setup, which will check your PR against the rules for EIP formatting automatically once you update your PR. This build ensures all required headers are present, as well as performing a number of other checks.

Please rebase your PR against the latest master, and edit your PR to use the above format for frontmatter. For convenience, here's a sample header you can copy and adapt:

---
eip: <num>
title: <title>
author: <author>
type: [Standards Track|Informational|Meta]
category: [Core|Networking|Interface|ERC] (for type: Standards Track only)
status: Draft
created: <date>
---

## Motivation


Per EIP-649 ( #669 ) periodic block reward reductions/variance are now planned in the roadmap, however, this EIP is consensus system agnostic and is most useful in decentralized pool operations and for any contract that benefits from knowing a block reward payout(i.e. Merge mined tokens)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

EIP-649 is now Final. You may want to update the text to reflect this.

@nicksavers nicksavers merged commit df507d5 into ethereum:master Mar 8, 2019
ilanolkies pushed a commit to ilanolkies/EIPs that referenced this pull request Nov 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants