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

EIP: Coinbase Calls #2474

Merged
merged 7 commits into from
Oct 3, 2020
Merged

Conversation

3esmit
Copy link
Contributor

@3esmit 3esmit commented Jan 19, 2020

Simple Summary

Allow contracts to be called directly by block.coinbase (block validator), without a transaction.

Abstract

In proof-of-work blockchains, validators are known as miners.

The validator might want to execute functions directly, without having to sign a transaction. Some examples might be presenting a proof in a contract for an change which also benefits the validator.

A notable example would be when a validator want to act as an EIP-1077 Gas Relayer, incentivized to pick up fees from meta transactions.
Without this change, they can do so by signing from any address a gasPrice = 0 transaction with the gas relayed call.
However this brings an overhead of a signed transaction by validator that does nothing, as msg.sender is never used, and there is no gas cost to EVM charge.

This proposal makes possible to remove this unused ecrecover.

Motivation

In order to reduce the overhead of calls that don't use msg.sender and are being called by validator with tx.gasPrice = 0.

Specification

The calls to be executed by block.coinbase would be included first at block, and would consume normally the gas of block, however they won't pay/cost gas, instead the call logic would pay the validator in other form.

Would be valid to execute any calls without a transaction by the block coinbase, except when the validator call tries to read msg.sender, which would throw an invalid jump.

Calls included by the validator would have tx.origin = block.coinbase and gas.price = 0 for the rest of call stack, the rest follows as normal calls.

Rationale

TBD

Backwards Compatibility

tx.origin = block.coinbase could cause some issues on bad designed contracts, such as using tx.origin to validate a signature, an analysis on how contracts use tx.origin might be useful to decide if this is a good choice.

Test Cases

TBD

Implementation

TBD

Security Considerations

TBD

Copyright

Copyright and related rights waived via CC0.

@3esmit 3esmit changed the title EIP: Coinbase calls EIP: Coinbase Calls Jan 19, 2020
@github-actions
Copy link

github-actions bot commented Sep 8, 2020

There has been no activity on this pull request for two months. It will be closed in a week if no further activity occurs. If you would like to move this EIP forward, please respond to any outstanding feedback or add a comment indicating that you have addressed all required feedback and are ready for a review.

@github-actions github-actions bot added the stale label Sep 8, 2020
Copy link
Contributor

@MicahZoltu MicahZoltu left a comment

Choose a reason for hiding this comment

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

Minor formatting adjustments, but otherwise looks good to merge. @3esmit is this still desired given that EIP-1559 is likely to make it so miners have to pay some amount for gas?

EIPS/eip-2474.md Outdated Show resolved Hide resolved
EIPS/eip-2474.md Outdated Show resolved Hide resolved
EIPS/eip-2474.md Outdated Show resolved Hide resolved
3esmit and others added 3 commits September 9, 2020 15:57
Co-authored-by: Micah Zoltu <micah@zoltu.net>
Co-authored-by: Micah Zoltu <micah@zoltu.net>
@github-actions
Copy link

This pull request was closed due to inactivity. If you are still pursuing it, feel free to reopen it and respond to any feedback or request a review in a comment.

@github-actions github-actions bot closed this Sep 17, 2020
@lightclient
Copy link
Member

It looks like there was activity after the initial stale notice, so this shouldn't have been closed?

@MicahZoltu
Copy link
Contributor

Hmm, good point...

@MicahZoltu MicahZoltu reopened this Sep 30, 2020
@MicahZoltu
Copy link
Contributor

@3esmit Waiting to merge this until I heard back from you on #2474 (review)

@github-actions github-actions bot removed the stale label Sep 30, 2020
@3esmit
Copy link
Contributor Author

3esmit commented Sep 30, 2020

@MicahZoltu This shouldn't relate to EIP-1559.
The proposed change in EIP 2474 makes possible to miners to include transactions that don't need a signer, because the validation is done in the smart contract.
If EIP-1559 makes miners have to pay some gas, this don't changes the fact that some transactions don't need a msg.sender.

This EIP is likely being replaced by #2938

Copy link
Contributor

@MicahZoltu MicahZoltu left a comment

Choose a reason for hiding this comment

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

@3esmit Would you prefer to close this PR in favor of Account Abstraction, or do you still want to pursue this separate from AA? If you want to pursue it, accept the suggested code change so the bot green lights and then @mention me so I remember to come back and merge. 😄

EIPS/eip-2474.md Outdated Show resolved Hide resolved
Co-authored-by: Micah Zoltu <micah@zoltu.net>
@3esmit
Copy link
Contributor Author

3esmit commented Oct 1, 2020

@MicahZoltu Ok, you can merge. For now we can left it as draft. Once AA gets defined/final, then move this to "abandoned".

@MicahZoltu MicahZoltu merged commit 6704cec into ethereum:master Oct 3, 2020
@lightclient
Copy link
Member

@3esmit FYI in case you haven't seen, #2938 defines AA (with working code!).

@3esmit
Copy link
Contributor Author

3esmit commented Oct 4, 2020

@3esmit FYI in case you haven't seen, #2938 defines AA (with working code!).

Awesome. Once 2938 gets final I will move this one to abandoned as it would not be necessary anymore.

tkstanczak pushed a commit to tkstanczak/EIPs that referenced this pull request Nov 7, 2020
Allow contracts to be called directly by block.coinbase (block validator), without a transaction.
Arachnid pushed a commit to Arachnid/EIPs that referenced this pull request Mar 6, 2021
Allow contracts to be called directly by block.coinbase (block validator), without a transaction.
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.

4 participants