-
Notifications
You must be signed in to change notification settings - Fork 5.3k
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
Conversation
Comments in issue
@realcodywburns #698 (comment)
@realcodywburns #698 (comment)
@realcodywburns #698 (comment)
|
EIPS/eip-opcodeBLKREWARD.md
Outdated
@@ -0,0 +1,98 @@ | |||
## Preamble | |||
|
|||
EIP: <to be assigned> |
There was a problem hiding this comment.
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.
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. |
There was a problem hiding this comment.
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: |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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:
- have an input parameter (block number)
- return 4 outputs: base reward, uncle reward, variable (gas) reward (as proposed here EIP-698: Add opcode 0x46 BLOCKREWARD #698 (comment)) - maybe even outputting total gas consumed
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.
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:
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:
|
New header formatting
## 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) |
There was a problem hiding this comment.
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.
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